Vaultwarden Database
-
Hi all- I'm a bit new to Cloudron and I've been testing Vaultwarden outside of Cloudron for a while (installed as an add-on through Home Assistant) and I need a little guidance on importing my SQLite database from Vaultwarden on Home Assistant to the MySQL database for Vaultwarden in Cloudron.
I can see the database url in the Vaultwarden Admin section, but I'm not quite sure how to connect to it in terminal.
Any help is greatly appreciated!
Thanks!
-
Of course, you always figure things out after posting, so I thought I'd do a mini-writeup on exporting your Vaultwarden database from the Home Assistant installation and bringing it into Cloudron's instance. Doing so brought over all of the users and organizations that were created before.
-
I followed this guide to take a SQLite dump of my Home Assistant Vaultwarden database.
-
Once I had the dump, I opened the web terminal for Vaultwarden in Cloudron and uploaded the dump to /tmp
-
Once the database was finished being uploaded, I put Vaultwarden in recovery mode (found under the repair section)
-
After, I clicked on the "MySQL" button, which pasts in the command to connect to the Vaultwarden database in Cloudron. Don't press enter - simply add the following after the connection string: < mysqldump.sql
The string should look something like this:
mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} < /tmp/mysqldump.sql
After completing these steps, I took Vaultwarden out of recovery mode, went to the admin page, and confirmed all users exported successfully.
-