[PR #4906] [MERGED] Add a CLI feature to backup the SQLite DB #16374

Closed
opened 2026-04-23 07:50:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/4906
Author: @BlackDex
Created: 8/30/2024
Status: Merged
Merged: 9/1/2024
Merged by: @dani-garcia

Base: mainHead: add-cli-backup-for-sqlite


📝 Commits (2)

  • 82559f8 Add a CLI feature to backup the SQLite DB
  • 9c07103 Spelling and small adjustments

📊 Changes

4 files changed (+108 additions, -33 deletions)

View changed files

📝 src/api/admin.rs (+11 -21)
📝 src/db/mod.rs (+15 -7)
📝 src/main.rs (+60 -5)
📝 src/util.rs (+22 -0)

📄 Description

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
  1. 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4906 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 8/30/2024 **Status:** ✅ Merged **Merged:** 9/1/2024 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `add-cli-backup-for-sqlite` --- ### 📝 Commits (2) - [`82559f8`](https://github.com/dani-garcia/vaultwarden/commit/82559f84c8e1a83419c964233b27e990c03d28f0) Add a CLI feature to backup the SQLite DB - [`9c07103`](https://github.com/dani-garcia/vaultwarden/commit/9c0710380a21f8c4bcf946cf42a81aabe27ebcc3) Spelling and small adjustments ### 📊 Changes **4 files changed** (+108 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `src/api/admin.rs` (+11 -21) 📝 `src/db/mod.rs` (+15 -7) 📝 `src/main.rs` (+60 -5) 📝 `src/util.rs` (+22 -0) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 07:50:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#16374