Restore backup for bitwadenrs/server

I have been using from more than a year bitwardenrs/server (with internal sqllite) from docker without any problems.
I have data folder with database (also several backups), config.json.
I want to be on the safe side and I want to test a recovery from backup. This process is not touched anywhere in the documentation. I tried to run another instance of docker with same (copied data) without any luck. I can access admin panel , but it isn’t any user defined inside.
Also I tried to convert the database into mysql format and use the bitwardenrs/mysql-server. No luck, the database it is restored, but I cannot access it from bitwarden interface.

Does anybody have any ideas?

1 Like

Thank you for that question, I backup BW (together with a SQL dump of the database) but somehow never tried to recover it.

The fact that another instance with a copy of the data does not work is worrisome indeed.

Have you tried to dump the database on the “production” BW instance (sqlite3 db.sqlite3 ".backup sqlite3.db.backup") and import it in the “recovery” instance?

It’s not called out prominently, but Backing up your vault · dani-garcia/vaultwarden Wiki · GitHub does say:

To restore simply overwrite db.sqlite3 with backup.sqlite3 (while bitwarden_rs is stopped).

This should work fine if you’re reverting an existing instance’s database to a previous version. If you’re restoring to a completely separate instance, you’ll want to restore config.json, the attachments directory and its contents, and the key files to that instance’s data folder as well.

Thank you very much both.
It works, (with or without restoring the database). I was mapping wrong path on the server side, that’s why didn’t work in the first time.

Here it is the docker compose file which I am using in my Synology:

version: ‘3’
image: bitwardenrs/server
container_name: bitwarden_second
- “3012:3012”
- “3333:80”
ADMIN_TOKEN: “your_admin_pass”
SMTP_FROM: “your_email”
SMTP_FROM_NAME: “Bitwarden_RS”
SMTP_USERNAME : “email_username”
SMTP_PASSWORD: “email_pass”
- /volume1/docker/bitwarden:/data
network_mode: bridge