Replicating automated backups to another AWS Region - Amazon Relational Database Service

Replicating automated backups to another AWS Region

For added disaster recovery capability, you can configure your Amazon RDS database instance to replicate snapshots and transaction logs to a destination AWS Region of your choice. When backup replication is configured for a DB instance, RDS initiates a cross-Region copy of all snapshots and transaction logs as soon as they are ready on the DB instance.

DB snapshot copy charges apply to the data transfer. After the DB snapshot is copied, standard charges apply to storage in the destination Region. For more details, see RDS Pricing.

Backup replication is available for RDS DB instances running the Oracle database engine. Backup replication isn't supported for encrypted DB instances.

Enabling cross-Region automated backups

You can enable backup replication on new or existing DB instances using the Amazon RDS console. You can also use the start-db-instance-automated-backups-replication AWS CLI command or the StartDBInstanceAutomatedBackupsReplication RDS API operation.

Note

To be able to replicate automated backups, make sure to enable them. For more information, see Enabling automated backups.

You can use the describe-source-regions CLI command to list the source AWS Regions that can replicate automated backups to a particular destination Region. For more information, see Finding information about replicated backups.

You can enable backup replication for a new or existing DB instance:

  • For a new DB instance, enable it when you launch the instance. For more information, see Settings for DB instances.

  • For an existing DB instance, use the following procedure.

To enable backup replication for an existing DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Automated backups.

  3. On the Current Region tab, choose the DB instance for which you want to enable backup replication.

  4. For Actions, choose Manage cross-Region replication.

  5. Under Backup replication, choose Enable replication to another AWS Region.

  6. Choose the Destination Region.

  7. Choose the Replicated backup retention period.

  8. Choose Save.

In the source Region, replicated backups are listed on the Current Region tab of the Automated backups page. In the destination Region, replicated backups are listed on the Replicated backups tab of the Automated backups page.

Enable backup replication by using the start-db-instance-automated-backups-replication AWS CLI command.

The following CLI example replicates automated backups from a DB instance in the US West (Oregon) Region to the US East (N. Virginia) Region.

To enable backup replication

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds start-db-instance-automated-backups-replication \ --region us-east-1 \ --source-db-instance-arn "arn:aws:rds:us-west-2:123456789012:db:mydatabase" \ --backup-retention-period 7

    For Windows:

    aws rds start-db-instance-automated-backups-replication ^ --region us-east-1 ^ --source-db-instance-arn "arn:aws:rds:us-west-2:123456789012:db:mydatabase" ^ --backup-retention-period 7

Enable backup replication by using the StartDBInstanceAutomatedBackupsReplication RDS API operation with the following parameters:

  • Region

  • SourceDBInstanceArn

  • BackupRetentionPeriod

Finding information about replicated backups

You can use the following CLI commands to find information about replicated backups:

The following describe-source-regions example lists the source AWS Regions from which automated backups can be replicated to the US West (Oregon) destination Region.

To show information about source Regions

  • Run the following command.

    aws rds describe-source-regions --region us-west-2

The output shows that backups can be replicated from Asia Pacific (Tokyo), but not from Asia Pacific (Seoul), into US West (Oregon).

{ "SourceRegions": [ { "RegionName": "ap-northeast-1", "Endpoint": "https://rds.ap-northeast-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-northeast-2", "Endpoint": "https://rds.ap-northeast-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false } ... ] }

The following describe-db-instances example shows the automated backups for a DB instance.

To show the replicated backups for a DB instance

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds describe-db-instances \ --db-instance-identifier mydatabase

    For Windows:

    aws rds describe-db-instances ^ --db-instance-identifier mydatabase

The output includes the replicated backups.

{ "DBInstances": [ { "StorageEncrypted": false, "Endpoint": { "HostedZoneId": "Z1PVIF0B656C1W", "Port": 1521, ... "BackupRetentionPeriod": 7, "DBInstanceAutomatedBackupsReplications": [{"DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"}] } ] }

The following describe-db-instance-automated-backups example shows the automated backups for a DB instance.

To show automated backups for a DB instance

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds describe-db-instance-automated-backups \ --db-instance-identifier mydatabase

    For Windows:

    aws rds describe-db-instance-automated-backups ^ --db-instance-identifier mydatabase

The output shows the source DB instance and automated backups in US West (Oregon), with backups replicated to US East (N. Virginia).

{ "DBInstanceAutomatedBackups": [ { "DBInstanceArn": "arn:aws:rds:us-west-2:868710585169:db:mydatabase", "DbiResourceId": "db-L2IJCEXJP7XQ7HOJ4SIEXAMPLE", "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-west-2:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE", "BackupRetentionPeriod": 7, "DBInstanceAutomatedBackupsReplications": [{"DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"}] "Region": "us-west-2", "DBInstanceIdentifier": "mydatabase", "RestoreWindow": { "EarliestTime": "2020-10-26T01:09:07Z", "LatestTime": "2020-10-31T19:09:53Z", } ... } ] }

The following describe-db-instance-automated-backups example uses the --db-instance-automated-backups-arn option to show the replicated backups in the destination Region.

To show replicated backups

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds describe-db-instance-automated-backups \ --db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"

    For Windows:

    aws rds describe-db-instance-automated-backups ^ --db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"

The output shows the source DB instance in US West (Oregon), with replicated backups in US East (N. Virginia).

{ "DBInstanceAutomatedBackups": [ { "DBInstanceArn": "arn:aws:rds:us-west-2:868710585169:db:mydatabase", "DbiResourceId": "db-L2IJCEXJP7XQ7HOJ4SIEXAMPLE", "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE", "Region": "us-west-2", "DBInstanceIdentifier": "mydatabase", "RestoreWindow": { "EarliestTime": "2020-10-26T01:09:07Z", "LatestTime": "2020-10-31T19:01:23Z" }, "AllocatedStorage": 50, "BackupRetentionPeriod": 7, "Status": "replicating", "Port": 1521, ... } ] }

Restoring to a specified time from a replicated backup

You can restore a DB instance to a specific point in time from a replicated backup using the Amazon RDS console. You can also use the restore-db-instance-to-point-in-time AWS CLI command or the RestoreDbInstanceToPointInTime RDS API operation.

For general information on point-in-time recovery (PITR), see Restoring a DB instance to a specified time.

To restore a DB instance to a specified time from a replicated backup

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose the destination Region (where backups are replicated to) from the Region selector.

  3. In the navigation pane, choose Automated backups.

  4. On the Replicated backups tab, choose the DB instance that you want to restore.

  5. For Actions, choose Restore to point in time.

  6. Choose Latest restorable time to restore to the latest possible time, or choose Custom to choose a time.

    If you chose Custom, enter the date and time that you want to restore the instance to.

    Note

    Times are shown in your local time zone, which is indicated by an offset from Universal Coordinated Time (UTC). For example, UTC-5 is Eastern Standard Time/Central Daylight Time.

  7. For DB instance identifier, enter the name of the target restored DB instance.

  8. (Optional) Choose other options as needed.

  9. Choose Restore to point in time.

Use the restore-db-instance-to-point-in-time AWS CLI command to create a new DB instance.

To restore a DB instance to a specified time from a replicated backup

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds restore-db-instance-to-point-in-time \ --source-db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE" \ --target-db-instance-identifier mytargetdbinstance \ --restore-time 2020-10-14T23:45:00.000Z

    For Windows:

    aws rds restore-db-instance-to-point-in-time ^ --source-db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE" ^ --target-db-instance-identifier mytargetdbinstance ^ --restore-time 2020-10-14T23:45:00.000Z

To restore a DB instance to a specified time, call the RestoreDBInstanceToPointInTime Amazon RDS API operation with the following parameters:

  • SourceDBInstanceAutomatedBackupsArn

  • TargetDBInstanceIdentifier

  • RestoreTime

Stopping automated backup replication

You can stop backup replication for DB instances using the Amazon RDS console. You can also use the stop-db-instance-automated-backups-replication AWS CLI command or the StopDbInstanceAutomatedBackupsReplication RDS API operation.

Replicated backups are retained, subject to the backup retention period set when they were created.

Stop backup replication from the Automated backups page in the source Region.

To stop backup replication to an AWS Region

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose the source Region from the Region selector.

  3. In the navigation pane, choose Automated backups.

  4. On the Current Region tab, choose the DB instance for which you want to stop backup replication.

  5. For Actions, choose Manage cross-Region replication.

  6. Under Backup replication, clear the Enable replication to another AWS Region check box.

  7. Choose Save.

Replicated backups are listed on the Retained tab of the Automated backups page in the destination Region.

Stop backup replication by using the stop-db-instance-automated-backups-replication AWS CLI command.

The following CLI example stops automated backups of a DB instance from replicating in the US West (Oregon) Region.

To stop backup replication

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds stop-db-instance-automated-backups-replication \ --region us-east-1 \ --source-db-instance-arn "arn:aws:rds:us-west-2:123456789012:db:mydatabase"

    For Windows:

    aws rds stop-db-instance-automated-backups-replication ^ --region us-east-1 ^ --source-db-instance-arn "arn:aws:rds:us-west-2:123456789012:db:mydatabase"

Stop backup replication by using the StopDbInstanceAutomatedBackupsReplication RDS API operation with the following parameters:

  • Region

  • SourceDBInstanceArn

Deleting replicated backups

You can delete replicated backups for DB instances using the Amazon RDS console. You can also use the delete-db-instance-automated-backups AWS CLI command or the DeleteDbInstanceAutomatedBackups RDS API operation.

Delete replicated backups in the destination Region from the Automated backups page.

To delete replicated backups

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose the destination Region from the Region selector.

  3. In the navigation pane, choose Automated backups.

  4. On the Replicated backups tab, choose the DB instance for which you want to delete the replicated backups.

  5. For Actions, choose Delete.

  6. On the confirmation page, enter delete me and choose Delete.

Delete replicated backups by using the delete-db-instance-automated-backup AWS CLI command.

You can use the describe-db-instances CLI command to find the Amazon Resource Names (ARNs) of the replicated backups. For more information, see Finding information about replicated backups.

To delete replicated backups

  • Run one of the following commands.

    For Linux, macOS, or Unix:

    aws rds delete-db-instance-automated-backup \ --db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"

    For Windows:

    aws rds delete-db-instance-automated-backup ^ --db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE"

Delete replicated backups by using the DeleteDbInstanceAutomatedBackup RDS API operation with the DbInstanceAutomatedBackupsArn parameter.