I recently setup vaultwarden and I am looking for a valid way to backup my data, mainly the postgres database. I have mounted it as a bind mount points to a dedicated app dataset. Currently I am backing up the data folder to a Storj cloud sync container, but I as far as I know, it won’t be backing up the database properly. What would be the best practices for this?
I understand that, but is there a way to automate it in the vaultwarden app container? or on the Truenas side? The vaultwarden docker that is included in the app section doesn’t contain the the tools unless you shell into the postgres container, which doesn’t have cron. This migtht be my lack of knowledge for docker.
I ran Vaultwarden too, but today I use sqlite3 backend and I just backup via sqlite3 {{container_dir}}/db.sqlite3 ".backup /tmp/{{backup_dir}}/db.sqlite3" in ansbile that runs outside of docker
It came down to my lack of docker knowledge, but I figured it out.
The new version uses postgres, sqlite3 would have been a lot easier. I did some more research an figured out how to execute pg_dump in the postgres container from outside the container. Then I created a cron for this to run each day.