You can back up and restore databases.
Back Up a Database
To back up a database, run the following command in the appliance:
/usr/local/desktone/scripts/backup_db.sh –P '<postgres_db_password>'
This command extracts a PostgreSQL database into an archive file, creating a backup file of the form <hostname>.<timestamp>.tar.gz in the /usr/local/desktone/backup folder.
Optional Commands - backup_db.sh accepts the following optional command line arguments.
Password for database user admin
Enable verbose mode
PostgreSQL username (default is postgres).
Restore a Database
The procedure below restores one database.
Note the following:
You must perform all restores on the primary appliance, and then re-initialize slony to populate the database to the secondary appliance.
If you need to restore a tenant appliance, you might need to restore both the edb and fdb databases.
To restore a database:
Run sudo bash and authenticate.
Stop dtService for both service provider appliances or for both tenant appliances:
service dtService stop
service dtService stop killall slon
On the primary appliance, complete these steps.
Copy the backup file to a directory in /tmp (the file has the form <hostname>.<timestamp>.tar.gz):
mkdir /tmp/backup_working cp /usr/local/desktone/backup/<filename> /tmp/backup_working
Extract the backup file:
cd /tmp/backup_working tar zxvf <filename>
Move to the directory where the .bak file exists and perform the restore. For example:
cd usr/local/desktone/backup env PGPASSWORD=<pswd> /usr/local/pgsql/bin/pg_restore -i -w -U admin -d <type> -v --clean <filename>
<pswd> is the postgres database password
<type> is the file type (either edb, fdb, or avdb)
<filenname > is the name of the extracted backup file
On both appliances, re-initialize slony. For instructions, see Slony Reinitialization.
Reboot both appliances.