# How can I force flush to database?

**URL:** https://vaultwarden.discourse.group/t/how-can-i-force-flush-to-database/5099
**Category:** Help
**Created:** [September 11, 2026, 3:35am UTC](https://vaultwarden.discourse.group/t/how-can-i-force-flush-to-database/5099 "2026-09-11T03:35:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![epaul](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@epaul](https://vaultwarden.discourse.group/u/epaul)
#### Post date: [September 11, 2026, 3:35am UTC](https://vaultwarden.discourse.group/t/how-can-i-force-flush-to-database/5099/1 "2026-09-11T03:35:56Z")

</div>

I’m using vaultwarden with docker and sqlite for the database with WAL, but as far as I can tell nothing is ever written to the database. The database file write date has never been updated since I first instantiated the server (the log date has), and all the tables are empty whenever I select \* from them. When I rebooted my machine and vaultwarden came back online, I found all my data was gone. No users, no passwords. It’s a good thing I took a backup before rebooting the server because, well, the database was empty so it was useless.

I managed to recover everything from the cache on the browser extension so my data is fine, but how can I prevent this in the future? How can I force vaultwarden to flush everything to the database?

Here is my docker-compose.yaml

```auto
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - ./data/:/data/
    ports:
      - <redacted>:8000:80

```

and my .env:

```auto
DATA_FOLDER=/srv/vaultwarden/data
TMP_FOLDER=/srv/vaultwarden/data/tmp
DATABASE_URL=sqlite:///srv/vaultwarden/data/db.sqlite3
DOMAIN=<redacted>
SIGNUPS_ALLOWED=false
SIGNUPS_DOMAINS_WHITELIST=
INVITATIONS_ALLOWED=false
EMAIL_CHANGE_ALLOWED=true
IP_HEADER_TRUSTED_PROXIES=<redacted>
HTTP_REQUEST_BLOCK_NON_GLOBAL_IPS=false
EXTENDED_LOGGING=true
LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S.%3f"
USE_SYSLOG=false
LOG_FILE=/data/log
LOG_LEVEL=info
ADMIN_TOKEN=<redacted>
SSO_ENABLED=true
SSO_ONLY=true
SSO_SIGNUPS_ALLOWED=true
SSO_SIGNUPS_MATCH_EMAIL=true
SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION=false
SSO_AUTHORITY=<redacted>
SSO_SCOPES="email profile offline_access"
SSO_CLIENT_ID=<redacted>
SSO_CLIENT_SECRET=<redacted>
SSO_CLIENT_CACHE_EXPIRATION=0

```

---

<div class="post-metadata">

### Author: ![epaul](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@epaul](https://vaultwarden.discourse.group/u/epaul)
#### Post date: [September 11, 2026, 3:48am UTC](https://vaultwarden.discourse.group/t/how-can-i-force-flush-to-database/5099/2 "2026-09-11T03:48:25Z")

</div>

I figured it out; I’m leaving this here for future generations.

Clearly I don’t know how docker works.

The log works…

```auto
LOG_FILE=/data/log

```

So the other data paths should be…

```auto
DATA_FOLDER=/data
TMP_FOLDER=/data/tmp
DATABASE_URL=sqlite:///data/db.sqlite3

```

And now the database file updates fine.

Sorry for the noise.
