> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/platform/introducing-digit/releases/digit-2.9-lts/backup-postgresql-database-in-aws-steps.md).

# Backup PostgreSQL Database In AWS - Steps

## Overview

This document provides step-by-step instructions on how to take backups of PostgreSQL databases hosted on AWS.

## **Pre-requisites**

* Access to an AWS account with permissions to manage Amazon RDS instances.
* PostgreSQL database hosted on Amazon RDS.

## **Steps**

**Step 1: Navigate to the Amazon RDS Console:**

* Log in to the AWS Management Console.
* Go to the Amazon RDS service.

**Step 2: Select the PostgreSQL Instance:**

* From the list of DB instances, select the PostgreSQL instance for which you want to take the backup.

**Step 3: Enable Automated Backups (Optional):**

* If automated backups are not already enabled, navigate to the "Backup" tab of the RDS instance.
* Click on "Modify" and enable automated backups.
* Configure the backup retention period according to your requirements.

**Step 4: Manually Trigger a Snapshot:**

To create a manual snapshot, select the RDS instance you want to back up. Click on the **Actions** button in the right upper corner and select **Take a snapshot**.

![](https://www.sqlservercentral.com/wp-content/uploads/2021/06/word-image-183.png)

This will redirect you to a page like the one below.

![](https://www.sqlservercentral.com/wp-content/uploads/2021/06/word-image-184.png)

Provide a meaningful name for the snapshot and click “**Create snapshot**”.

![](https://www.sqlservercentral.com/wp-content/uploads/2021/06/word-image-185.png)

This will create a manual snapshot of the DB instance that you created.

![](https://www.sqlservercentral.com/wp-content/uploads/2021/06/word-image-186.png)

**Step 5: Create a Manual Backup Using pg\_dump:**

* Connect to the PostgreSQL database using a PostgreSQL client tool or command-line interface.
* Use the `pg_dump` command to export the database to a file:

  ```bash
  bashCopy codepg_dump -h <hostname> -U <username> -d <database_name> -f <backup_file_name>.sql
  ```

  Replace `<hostname>`, `<username>`, `<database_name>`, and `<backup_file_name>` with the appropriate values.

**Step 6: Copy Backup Files to Amazon S3 (Optional):**

* If desired, copy the backup files to Amazon S3 for long-term storage and redundancy.
* Use the AWS CLI or SDKs to upload the files to an S3 bucket.

## Summary

This page provides instructions on how to take backups of PostgreSQL databases hosted on AWS. Regular backups are essential for data protection and disaster recovery purposes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/platform/introducing-digit/releases/digit-2.9-lts/backup-postgresql-database-in-aws-steps.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
