I am using an SSD on my Truenas setup for IX Applications. Here I have also created an encrypted dataset for my vaultwarden installation.
I would like to know what is the best way to backup Vaultwarden in particular? I have not found a good answer for this online. I am thinking that maybe duplicating the whole dataset to local storage and encrypt a copy to cloud storage. But, then I have no idea how to restore from these backups.
Vaultearden stores all persistent data inside the ./data folder I believe (check the docs for this) I would mount that using a host volume, then back up that dataset using replication to another server.
For me, everything Is in the /data folder, like docs mention (i migrate from jail to docker compose with the same path).
Same docs mention too
By default, vaultwarden stores all of its data under a directory called data (in the same directory as the vaultwarden executable)
And provide the strutture of the folder
data
├── attachments # Each attachment is stored as a separate file under this dir.
│ └── # (The attachments dir won’t be present if no attachments have been created.)
│ └── <random_id>
├── config.json # Stores admin page config; only exists if the admin page has been enabled before.
├── db.sqlite3 # Main SQLite database file.
├── db.sqlite3-shm # SQLite shared memory file (not always present).
├── db.sqlite3-wal # SQLite write-ahead log file (not always present).
├── icon_cache # Site icons (favicons) are cached under this dir.
│ ├── .png
│ ├── example.com.png
│ ├── example.net.png
│ └── example.org.png
├── rsa_key.der # rsa_key.* files are used to sign authentication tokens.
├── rsa_key.pem
├── rsa_key.pub.der
└── sends # Each Send attachment is stored as a separate file under this dir.
└── # (The sends dir won’t be present if no Send attachments have been created.)
└── <random_id>
so it would appear that indeed this folder Is named differently in your case, but the structure should be the same (if you run SQL lite).
Can you find a folder with this structure path in your installation?
I also see that in some image the /data folder Is named /vw-data.
Is not so “readable” but seems conciding with the data folder structure, except i didn’t see a config json file. You are using postgree sql so is legit that the data structure i posted above is quite different.
Exactly what i do, and (already done) it works as a full backup as well.
But i’m using sqllite (for my small usage is more than enough), should work with postgree too but for be 100% sure i will try to simulate e restore cloning the dataset in another one and switching (or create another same app with the new dataset)
Yea sorry, did not have an option to provide a better paste right now
Ill just stick with the replication task for the time being, and, run a test also. I think Ill change the storage locations within the app to use the ones stored on my mirror. If all works then good.
I also have a secret backup of a .json encrypted exported via the Vaultwarden interface. (If all goes to …)
Btw. Is there much difference in terms of required resources between these two.? sqlite would be more than enough for my miniscule data heap. Just stuck with postgree out of the box.
Honestly, don’t know how exactly can impact that in resource terms, and if have sense “downgrade”.
If you want i can share with you that my VW container use less than 50mb of ram in “idle” and 60~65 mb during access. Cpu usage is so small that is hard to estimate
Probably using SQLlite than Postgree is way better in small scenario where you can’t simply “replicate a dataset”, so you need to backup/dump properly db too (same for Mariadb).