In the last post, I wrote about installing bitwarden_rs per Docker on Synology and how to activate live sync. Now I’ll show you how to backup the data. I’ll use bruceforce/bw_backup docker to dump the sqlite database automatically, since just copying the sqlite3 file is not really backing up the database. I also found out, that the created dump file won’t be automatically uploaded to cloud by the Cloud Sync. Some how Cloud Sync doesn’t notice that there’s a new file.
Setting up backup container
In the Docker app, let’s search for
bruceforce/bw_backup container. Just search for
After downloading the image, we’ll just run it. During the initialisation, we need to adjust some settings.
In the volume tab, we mount the bitwarden folder, in which the bitwarden files are stored. My Bitwarden data are saved in
docker/bitwardenrs. This folder must be mount as
In the environment tab, we need to adjust the UID and GID. I set them to 0 (root).
Crontime can be set to how often the Bitwarden data should be backed up. If you don’t familiar with crontab format, you can use crontab.guru to check the time.
A useful parameter is
DELETE_AFTER. I set this parameter to 7, so older than 7 backup files will be removed automatically. The complete documentation on the image can be found on the Github page.
Backup to cloud storage
When the backup script in the container is finished, you’ll find the dump file in the
db_backup folder. Adding this folder to a Cloud Sync task to automatically upload the file to a cloud provider (Google Drive, Dropbox, etc.) won’t work. Somehow Cloud Sync ignores the files.
The only way to upload the files to a cloud storage per Cloud Sync is to manually copy them. After manual copying the files, Cloud Sync notices the files and sync these with cloud storage. To automate the copying process, we set a “User-defined script” task in Task Scheduler to copy the files.
As script/command I just simply run a
rsync to sync the bitwarden folder to a cloud storage folder in Synology.
rsync -av --delete /volume2/docker/bitwardenrs /volume2/Dropbox/bitwarden_rs/.
2 thoughts on “Backup bitwarden_rs data on Synology”
Thank you for these instructions. I have one question.
I have everything setup and tried the backup every 5 minutes (*/5 * * * *).
However, it does not backup. I let it sit overnight and this morning, only 1 backup in the db_backup folder and it was from 0100 hours.
I have timestamp = true and # of backups set to 10. Any idea on why it will not backup? Thank you again.