[GH-ISSUE #223] DB restore #111

Closed
opened 2026-03-03 01:24:59 +03:00 by kerem · 5 comments
Owner

Originally created by @Biepa on GitHub (Oct 15, 2018).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/223

Hello together,
I am using the command in the documentation to backup the db.
sqlite3 /$DATA_FOLDER/db.sqlite3 ".backup '/$DATA_FOLDER/db-backup/backup.sq3'"

Unfortunately my knowledge about databases is very limited.
How do I restore a backup.sq3 file?

Tried it with...
sqlite3 db.sqlite3 < backup.sq3
but getting a "syntax error".

Is that because of the different endings?

Originally created by @Biepa on GitHub (Oct 15, 2018). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/223 Hello together, I am using the command in the documentation to backup the db. `sqlite3 /$DATA_FOLDER/db.sqlite3 ".backup '/$DATA_FOLDER/db-backup/backup.sq3'"` Unfortunately my knowledge about databases is very limited. How do I restore a backup.sq3 file? Tried it with... `sqlite3 db.sqlite3 < backup.sq3` but getting a "syntax error". Is that because of the different endings?
kerem 2026-03-03 01:24:59 +03:00
Author
Owner

@dani-garcia commented on GitHub (Oct 15, 2018):

The backup should be a simple copy of the original database, I think. I'm not sure why we are using different extensions, that seems confusing.

Simply replace the db.sqlite3 file with the backup to restore it (This probably needs to be done when bitwarden_rs is stopped)

<!-- gh-comment-id:429863257 --> @dani-garcia commented on GitHub (Oct 15, 2018): The backup should be a simple copy of the original database, I think. I'm not sure why we are using different extensions, that seems confusing. Simply replace the `db.sqlite3` file with the backup to restore it (This probably needs to be done when bitwarden_rs is stopped)
Author
Owner

@Biepa commented on GitHub (Oct 15, 2018):

A simple copy with stopped container worked without problems. Thank you for the quick answer.

<!-- gh-comment-id:429866236 --> @Biepa commented on GitHub (Oct 15, 2018): A simple copy with stopped container worked without problems. Thank you for the quick answer.
Author
Owner

@mprasil commented on GitHub (Oct 15, 2018):

Agreed, I think we should also add restore information. I guess @Biepa was trying to approach this as restore from dump as it's more common with MySQL/Postgres? So maybe we need to be more specific that .backup command does consistent copy of the binary database and it's not the same as .dump which is probably what @Biepa was expecting.

<!-- gh-comment-id:429873092 --> @mprasil commented on GitHub (Oct 15, 2018): Agreed, I think we should also add restore information. I guess @Biepa was trying to approach this as restore from dump as it's more common with MySQL/Postgres? So maybe we need to be more specific that `.backup` command does consistent copy of the binary database and it's not the same as `.dump` which is probably what @Biepa was expecting.
Author
Owner

@Biepa commented on GitHub (Oct 15, 2018):

@mprasil You're right. That was, what I expected.
And if there isn't a need for the different endings, maybe that could also be changed in the documentation as it confused me a bit.

<!-- gh-comment-id:429876261 --> @Biepa commented on GitHub (Oct 15, 2018): @mprasil You're right. That was, what I expected. And if there isn't a need for the different endings, maybe that could also be changed in the documentation as it confused me a bit.
Author
Owner

@dani-garcia commented on GitHub (Oct 15, 2018):

The documentation is updated now with #224

<!-- gh-comment-id:430010341 --> @dani-garcia commented on GitHub (Oct 15, 2018): The documentation is updated now with #224
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#111
No description provided.