How to force a nightly backup?

Hello. I’m using Bitwarden server on my VirtualBox machine, It says

Bitwarden will automatically take nightly backups of the mssql container database. These backups are kept in the ./bwdata/mssql/backups directory for 30 days. In the event of data loss, you can use ./bwdata/mssql/backups to restore a nightly backup.

However I set up the server two days ago, and the folder ./bwdata/mssql/backups is empty. How can I force Bitwarden to make a nightly backup when needed?

To manually run the backup

docker exec -i bitwarden-mssql /backup-db.sh

1 Like

thank you for the answer, that’s works! could you pls help me with customizing the schedule of the automatic backups? i mean, to do every morning/week/etc

If you are on Windows, you can just use the Windows Task Scheduler to run the command @sugianto mentioned above on any schedule you like.

If you are on Mac or Linux, you can achieve the same thing using crontab to schedule a recurring cron job.

1 Like

Hi,

I’m using bitwarden-selfhosted 2022.12.0. If I start the command:
“docker exec -i bitwarden-mssql /backup-db.sh”
The answer is:
Msg 911, Level 16, State 11, Server 8d630a49fcd3, Line 1
Database ‘vault’ does not exist. Make sure that the name is entered correctly.
Msg 3013, Level 16, State 1, Server 8d630a49fcd3, Line 1
BACKUP DATABASE is terminating abnormally.
docker ps shows me that the container bitwarden-mssql is running.
Any idea ?
Thank you

Solved with new instalation.