Database Backup
The following guide is for backing up and restoring the database when redeploying.
Assume Postgres user
sudo su postgres
Start psql and list databases
psql
\lUse pg_dump to dump the file
pg_dump galaxy > galaxyMMDDYYYY
(optional) As a precaution, SFTP file off of server or place in persistent directory. SFTP is safest. You can assume root and move from Postgres home dir to cloud home dir, then transfer to your local.
Database Restore
- If step 4 was performed in the database backup section, SFTP file back onto server.
- Stop galaxy service from root
Sudo su postgres
- Drop automatically created galaxy db and create it fresh. Import your backup.
psql -c "drop database galaxy"
psql -c “create database galaxy"
psql -d galaxy < galaxyMMDDYYYY