Bitwarden_rs automatic backup for data Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
mail2rst
Posts: 110
Joined: Fri Apr 13, 2018 4:53 pm

Bitwarden_rs automatic backup for data

Post by mail2rst »

I just want backup of my bitwarden data so that if due to some reason my active installation fail. i will reproduce my vault by new empty installation & copy backup data file in to new installation (overwrite database file)& i will retrieve all my password vault. in online search i found i have to backup only "db.sqlite3". please suggest me if it is correct for dietpi installation also. my plan is i will make bash file & put it into cron command so that it will do that automatically. for dietpi i just want to save backup file on same machine. i will retrieve that file via PROFTP server.
my plan> stop bitwarden> wait two minute> copy database file with current date in name> wait two minute> start bitwarden

is this bash file seems correct or need to change? any pro or cons for only data file or i have to copy all the folder "/mnt/dietpi_userdata/bitwarden_rs"

any expert suggesstion

#!/bin/sh

sudo systemctl stop bitwarden_rs.service
sudo sleep 120
sudo cp /mnt/dietpi_userdata/bitwarden_rs/db.sqlite3 /mnt/dietpi_userdata/bitwarden_rs/"backup.sqlite3.$(date +%F_%R)"
sudo sleep 120
sudo systemctl start bitwarden_rs.service
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Bitwarden_rs automatic backup for data

Post by Joulinar »

Hi,

DietPi is going to install a default vaultwarden (aka bitwarden_rs). Therefore you should be able to use such a backup script.

Found some interesting guide how to backup your data. Would be some database export https://lab.uberspace.de/guide_bitwarde ... -practices

Means, it would not be needed to stop the service.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
mail2rst
Posts: 110
Joined: Fri Apr 13, 2018 4:53 pm

Re: Bitwarden_rs automatic backup for data

Post by mail2rst »

i concluded in this setup after some person suggest me make zip file for whole folder. In my machine three senstive things are running so i made zipfile for these three servicies, #bitwarden_rs #homeassistant #zigbee2mqtt


#!/bin/sh
sudo systemctl stop bitwarden_rs.service
sudo systemctl stop home-assistant.service
sudo sleep 60
tar -zcf /mnt/dietpi_userdata/my_backup/"backup.bitwarden.$(date +%F_%R).tar.gz" /mnt/dietpi_userdata/bitwarden_rs
tar -zcf /mnt/dietpi_userdata/my_backup/"backup.homeassistant.$(date +%F_%R).tar.gz" /mnt/dietpi_userdata/homeassistant
tar -zcf /mnt/dietpi_userdata/my_backup/"backup.zigbee2mqtt.$(date +%F_%R).tar.gz" /mnt/dietpi_userdata/zigbee2mqtt
sudo sleep 60
sudo systemctl start bitwarden_rs.service
sudo systemctl start home-assistant.service
jetspeed
Posts: 8
Joined: Thu Feb 18, 2021 10:02 am

Re: Bitwarden_rs automatic backup for data

Post by jetspeed »

I've been using the excellent backup script from https://github.com/jjlin/vaultwarden-backup and it works well.

You need to make some minor modifications to get to work with DietPi.

You can also set it up to sync the PGP encrypted files to cloud storage such as DropBox, or anything supported by rclone.
Post Reply