Backup PostgreSQL Database

Backup PostgreSQL Database Using SnapShooter

In this section, we will show you how to backup the PostgreSQL database using SnapShooter.

SnapShooter provides an easier way to create backups and archives from your server and store them in your own storage. Follow the below steps to back up the PostgreSQL database to the Amazon S3, but you can replace in your own storage.

Step 1 - On the SnapShooter dashboard, click on the Backup Jobs in the left sidebar. You should see the following screen:

Step 2 - Click on Create New Job. You should see the various database option on the following screen:

Step 3 - Click on PostgreSQL Databases. You should see the following screen:

Step 4Continue button. You should see the Add Your Server screen: - Provide your backup name and click on the

Step 5 - Now, copy the code shown in the above screen and paste it to your PostgreSQL server as shown below:

curl -sSL "https://ingestor.snapshooter.com/api/server/add?token=eyJpdiI6IjF2WUErRFg2UkZkMXdXaXYrei9DT2c9PSIsInZhbHVlIjoiby9qYkhjZUQvTmhlcy9ReEQzcjc1dz09IiwibWFjIjoiMzlhMGIzYTA5MTk2Y2VhODZkMzI1YTE1NjIxMzgzNmFmYjA2OWU5ZDgxZDU3NDhkOWE0M2Q1Yzc0Nzg2MTdlNSIsInRhZyI6IiJ9&key=5895" | bash

You will get the following output:

Welcome to SnapShooter Server Setup
Environment Detected: OS: linux, OS Type: amd64
Installing SSH public key
Creating temp SSH key file
grep: /root/.ssh/authorized_keys: No such file or directory
cp: cannot stat '/root/.ssh/authorized_keys': No such file or directory
Creating authorized_keys backup /root/.ssh/authorized_keys.bak-1644581151
Key Installed /root/.ssh/authorized_keys
Removing temp SSH key file
Scanning SSH config
Checking 22
matched (22)
SSH test confirmed, Server Added to SnapShooter ...

Step 6 - Once your PostgreSQL server is added to the SnapShooter, you should see the PostgreSQL database configuration screen:

Step 7 - Provide your PostgreSQL username, password, host, port, and click on the Test button to test the connection. If everything is fine, you should see the following screen:

Step 8 - Click on the Save and Next button. You should see the Storage Selection screen:

Step 9 - Here, you will need to define your AWS S3 storage to store the PostgreSQL database. Click on the Add New Storage Provider. You should see the following screen:

Step 10 - Click on the Config S3 to connect your AWS S3. You should see the following screen:

Step 11 - Provide your friendly name, select your storage provider, define your region, provide your S3 bucket name, Access Key, Secret Key and click on the Test and Save button. Once your AWS S3 is connected to the SnapShooter, you should see the following screen:

Step 12 - Click on the Set Storage button to set your AWS S3 as default storage. You should see the Backup Schedule Setup screen:

Step 13 - Select and define all options as per your requirements and click on the Set Schedule and Finish button. You should see the following screen:

Step 14 - Click on the Backup Now button to run your first backup job. Once your backup job is executed successfully, you should see the following screen:

Step 15 - You can now verify all databases by logging in to the Amazon Web Console, search for S3 and click on your bucket name. You should see the following screen:

Conclusion

In the above guide, you learned how to backup the PostgreSQL database to Amazon S3 using SnapShooter and manually. I hope you can now easily back up any databases to Amazon S3 using SnapShooter.


Was this page helpful?

Thank you for helping us improve!