How to backup PostgreSQL on Amazon RDS Platform?
Article ID
20003
Description
Please use the following steps to backup PostgreSQL databases using AhsayOBM on Amazon RDS platform.
Create backup set
- Login to your OBM user account via the AhsayCBS web management console.
- Go to User.
- Open Backup Sets.
- Click the [+] sign to create a new backup set.
- To proceed, check the names of the databases you aim to backup first.
- Use a utility like pgAdmin 4.
- Connect to the PostgreSQL server.
- Under the PostgreSQL server, select Databases.
- Use a utility like pgAdmin 4.
- Ater confirming the databases, go back to your AhsayCBS web management console.
- Change the backup set type to PostgreSQL Backup.
- Rename the file backup set.
- Select Linux for platform.
- Enter the login ID and password, followed by the hostname of the machine used.
- You may keep the Port value on default or change it accordingly if your PostgreSQL database instance is setup using a different port.
- Before entering the path for pg_dump, make sure that the PostgreSQL version on the Amazon RDS platform matches the version installed on the backup machine you're using. You have 2 options:
- Connect to the PostgreSQL server using a utility like pgAdmin 4.
- Select the server.
- Open the Properties tab and check the version.
- Connect to the PostgreSQL server using a utility like pgAdmin 4.
- Login as root to the Linux CLI machine using an SSH client.
- Go to the bin directory.
- Enter the following command: pg_dump --version
- Under Other selected source, click the [+] button to add a backup source.
- Manually enter the directory path of each database you intent to backup. Click the [+] to continue.
- Repeat the same step if you intend to add other sources as well.
- Click Next to continue.
- Enter the host name to use the computer name for the scheduler.
- You may use the default schedule provided or create a new one.
- Click Next.
- Click the [+] button to add a new storage destination and select AhsayCBS.
- Click the [+] button again.
- Leave the backup mode on Sequential.
- Click Save.
Configure the settings before running a backup job
- Click on the backup set.
- Recommended: Open Retention Policy and enable Simple retention policy for 60 days.
- Click Others and configure the Temporary Directory.
- Leave Compressions on default. Encryption key will be set up on Linux CLI.
- Scroll down and enable File Viewer.
- Click Save.
Set up the encryption key
- Login as root to the Linux backup machine using an SSH client.
- Use the cd command to go to bin: cd /usr/local/obm/bin
- Open AhsayOBM to setup the encryption key: sh RunConfigurator.sh
- Enter 1 to login.
- Enter the login name and password.
- Enter Y to setup the encryption key of your backup set.
- Enter Y again to confirm.
- Enter 1 to select Default.
- Enter 8 to quit.
Run the backup job
- Use the sh command to run the backup job: sh RunBackupSet.sh '[backup set name]'
- After the backup job, a line will indicate Backup Completed Successfully.
Check the backed up databases from File Viewer
- Open File Viewer and reload the page.
- Select the backup set.
- Click on the PostgreSQL folder to see all the databases backed up.