Self-hosted Bitwarden has an automated backup feature that’s described in this help document.
However, the document doesn’t give specific details on how to restore the SQL database. Instead it just gives a link to a Microsoft document that provides generic info.
Does anybody have specific instructions on how to restore the SQL database in Docker running under Windows?
Hi robpur, I was working on the same thing today. Here’s what I came up with (on Docker for OS X, though I don’t think that will make a difference). You can find your SA password needed for the commands below in bwdata/env/mssql.override.env.
Use docker and the sqlcmd CLI to restore from a backup like so:
docker exec -it bitwarden-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YOUR_SA_PASSWORD>' -Q "RESTORE DATABASE vault FROM DISK = '/etc/bitwarden/mssql/backups/vault.bak' WITH REPLACE";
I’m having an issue where mssql is crashing repeatedly. I want to try restoring a backup to see if that helps, but with the container not running I can’t run any such docker commands.