# Backing up and Restoring the Vaultwarden SQL DB

## Postgresql databases

### Configure database connections in pgAdmin​

run the [tcdbinfo.sh](https://docs.coltscomputer.services/books/colthome/page/get-app-passwords-script "Get App Passwords Script") script to see the connection details for both the old and the new database, and set them up in pgAdmin.

![tcdbinfo](https://truecharts.org/assets/images/tcdbinfo-917e5b10b5b759296c808297c4e8fdca.png) ![PG Admin Connect](https://truecharts.org/assets/images/pgadminconnect-6d5caf3ae1fe0bc7830a1ab57f45f246.png)

### Create database Backup​

In `pgAdmin`, right click `vaultwarden->Databases->vaultwarden` and click `Backup...`. Give the file a name (e.g. `vaultwarden.sql`) and click `Backup`.

![PG Admin Select Backup](https://truecharts.org/assets/images/pgadminbackupselect-a2c00a466137f9f1f30a7552dcee8a08.png) ![PG Admin Backuo](https://truecharts.org/assets/images/pgadminbackup-1afe560924d05bdc816329b5e7a847a2.png)

### Restore database backup​

In `pgAdmin`, right click `testwarden->Databases->vaultwarden` and click `Restore...`. Select the sql file (`vaultwarden.sql`).

![PG Admin Restore](https://truecharts.org/assets/images/pgadminrestore-0f29009898ad568405fb777cf293b8d5.png) ![PG Admin Restore](https://truecharts.org/assets/images/pgadminrestorepage1-95dbb40e350b35859b097d6d6e3e3df0.png)

On the 2nd tab page, select the first 3 options (`Pre-data`, `Data` and `Post-data`). On the last tab, select `Clean before restore`. Now click `Restore`.

![PG Admin Restore](https://truecharts.org/assets/images/pgadminrestorepage2-79f5fb6989730625e8831fa18a9bbd41.png) ![PG Admin Restore](https://truecharts.org/assets/images/pgadminrestorepage3-6dab1802dafea65f3ff4c30890faaac4.png)

## [​](https://truecharts.org/manual/SCALE/guides/migration-pvc/#postgresql-databases "Direct link to Postgresql databases")