Table of Contents
Backing up and Restoring a PostgreSQL database
Backing up a PostgreSQL database
To backup a PostgreSQL database, do the following.
- Sign in to Virtualmin (see Account logins and important URLs).
- Select a domain from the drop-down in the left-hand navigation (your main domain should be already selected when you first login to Virtualmin).
- Click Edit Databases. You should now see a list of your current databases on the Edit Databases page.
- Select the PostgreSQL database you want to back up from the left-hand column under Database name and click Manage... You should now see the Edit Database page.
- Click Backup. You should now see the Backup Database page.
- For Backup file path, enter a location on your account where you want the database to be saved and a suitable filename (e.g., /users/home/yourusername/dbbackup). Clicking … will allow you to browse to a suitable location on your account.
- For Backup file format, select your desired format for the file.
- For Tables to backup, select either All tables or choose a specific table to backup.
- Now, click Backup Now. You should now see a page confirming a successful backup and your database should be saved in your desired location
And that's it, you've just made a backup of your PostgreSQL database!
Restoring a PostgreSQL database
To restore a PostgreSQL database, do the following.
- Sign in to Virtualmin (see Account logins and important URLs).
- Select a domain from the drop-down in the left-hand navigation (your main domain should be already selected when you first login to Virtualmin).
- Click Edit Databases. You should now see a list of your current databases on the Edit Databases page.
- Select the PostgreSQL database you want to back up from the left-hand column under Database name and click Manage... You should now see the Edit Database page.
- Click Restore. You should now see the Restore Database page.
- For File on server, enter the path on your account to the PostreSQL file you want to restore (clicking … will allow you to browse and select the file) or select Uploaded file and click Choose File to select a file from your local machine.
- Now, click Restore. You should now see the Import Data page confirming a successful restoration and your PostgreSQL database.
And that's it, you've just restored your PostgreSQL database!
