Skip to main content

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

  1. Login to your OBM user account via the AhsayCBS web management console.
  2. Go to User.
  3. Open Backup Sets.
  4. Click the [+] sign to create a new backup set.
  5. 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.
  6. Ater confirming the databases, go back to your AhsayCBS web management console.
  7. Change the backup set type to PostgreSQL Backup.
  8. Rename the file backup set.
  9. Select Linux for platform.
  10. Enter the login ID and password, followed by the hostname of the machine used.
  11. You may keep the Port value on default or change it accordingly if your PostgreSQL database instance is setup using a different port.
  12. 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.
  • Login as root to the Linux CLI machine using an SSH client.
    • Go to the bin directory.
  • Enter the following command: pg_dump --version
  1. Under Other selected source, click the [+] button to add a backup source.
  2. Manually enter the directory path of each database you intent to backup. Click the [+] to continue.
  3. Repeat the same step if you intend to add other sources as well.
  4. Click Next to continue.
  5. Enter the host name to use the computer name for the scheduler.
  6. You may use the default schedule provided or create a new one.
  7. Click Next.
  8. Click the [+] button to add a new storage destination and select AhsayCBS.
  9. Click the [+] button again.
  10. Leave the backup mode on Sequential.
  11. Click Save.

Configure the settings before running a backup job

  1. Click on the backup set.
  2. Recommended: Open Retention Policy and enable Simple retention policy for 60 days.
  3. Click Others and configure the Temporary Directory.
  4. Leave Compressions on default. Encryption key will be set up on Linux CLI.
  5. Scroll down and enable File Viewer.
  6. Click Save.

Set up the encryption key

  1. Login as root to the Linux backup machine using an SSH client.
  2. Use the cd command to go to bin: cd /usr/local/obm/bin
  3. Open AhsayOBM to setup the encryption key: sh RunConfigurator.sh
  4. Enter 1 to login.
  5. Enter the login name and password.
  6. Enter Y to setup the encryption key of your backup set.
  7. Enter Y again to confirm.
  8. Enter 1 to select Default.
  9. Enter 8 to quit.

Run the backup job

  1. Use the sh command to run the backup job: sh RunBackupSet.sh '[backup set name]'
  2. After the backup job, a line will indicate Backup Completed Successfully.

Check the backed up databases from File Viewer

  1. Open File Viewer and reload the page.
  2. Select the backup set.
  3. Click on the PostgreSQL folder to see all the databases backed up.