-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a CLI feature to backup the SQLite DB #4906
Add a CLI feature to backup the SQLite DB #4906
Conversation
Many users request to add the sqlite3 binary to the container image. This isn't really ideal as that might bring in other dependencies and will only bloat the image. There main reason is to create a backup of the database. While there already was a feature within the admin interface to do so (or by using the admin API call), this might not be easy. This PR adds several ways to generate a backup. 1. By calling the Vaultwarden binary with the `backup` command like: - `/vaultwarden backup` - `docker exec -it vaultwarden /vaultwarden backup` 2. By sending the USR1 signal to the running process like: - `kill -s USR1 $(pidof vaultwarden) - `killall -s USR1 vaultwarden) This should help users to more easily create backups of there SQLite database. Also added the Web-Vault version number when using `-v/--version` to the output. Signed-off-by: BlackDex <black.dex@gmail.com>
Signed-off-by: BlackDex <black.dex@gmail.com>
b6bbdf1
to
9c07103
Compare
Quick question about the new update: it only covers SQLite right? I'm wondering if this would be enough to recover from a complete loss of a Vaultwarden deployment? Currently, I'm running ttionya/vaultwarden-backup to maintain backups in case I need to spin up the server again. It covers
|
It only covers the database currently. So i would suggest to keep using that tool. |
Makes complete sense, thank you |
@dani-garcia do you mind updating backup section in the wiki to mention this command? If I wouldn't follow release changelogs I'd never know it is there. |
You may do that your self if you want. The wiki van be adjusted by everybody. |
@BlackDex I've updated it but am surpirsed there is no pre-moderation for such changes. Hopefully my changes are fine. Thank you! |
Looks good. Thanks! |
Many users request to add the sqlite3 binary to the container image. This isn't really ideal as that might bring in other dependencies and will only bloat the image. There main reason is to create a backup of the database.
While there already was a feature within the admin interface to do so (or by using the admin API call), this might not be easy.
This PR adds several ways to generate a backup.
backup
command like:/vaultwarden backup
docker exec -it vaultwarden /vaultwarden backup
kill -s USR1 $(pidof vaultwarden)
killall -s USR1 vaultwarden
This should help users to more easily create backups of there SQLite database.
Also added the Web-Vault version number when using
-v/--version
to the output.