Skip to content

Restoring a Backup on a Staging Server

The point of a staging server is to run the production code against production data. This page is how the data gets there: pick a production backup and restore it onto the staging server's PostgreSQL cluster.

Overview

  1. Stop the staging server.
  2. (optional) Drop the existing database.
  3. Restore a backup (pg_dump) onto the staging PostgreSQL cluster.
  4. Point the staging server at the restored database.
  5. Restart the staging server.

1. Stop the staging server

Open the staging server's form (see Accessing Your Servers), go to the Systemd tab, and click Stop All.

Check that the services' Substate becomes Dead before continuing.

2. Drop the existing database

Still on the server's form, open the Databases tab. In the Filtered Databases list, click Drop on the line of the database you want to remove, then Update Databases List to confirm it is gone.

If the database is still there, it is because another program still holds a connection to it. Contact Muppy support if you cannot find and close it.

3. Restore the backup

The same Databases tab has a Restore Database Backup button. It opens the restore wizard already filled in with this server's PostgreSQL cluster, database name and owner — which is why starting from here beats starting from the backup.

Pick the backup to restore, check the destination, and launch.

Tip

You can also start from the backup itself: Muppy / Databases / PostgreSQL / pg_dumps, filter down to the dump you want, open it and click Restore. You then have to supply the destination cluster, owner and database name by hand.

The wizard's own options — parallel jobs, --clean, restore callbacks, closing existing connections — are described in Restoring Backups.

4. Point the server at the restored database

Back on the Databases tab, click Update Databases List, then Set as PGDATABASE on the line of the database you want the server to use.

5. Restart the staging server

Return to the Systemd tab and click Start All.