Skip to content

How do I restore the backup of my DynamoDB table to a different Region?

3 minute read
0

I want to restore the backup of my Amazon DynamoDB table to a different AWS Region.

Short description

To restore your DynamoDB table to a different Region, complete one of the following actions:

  • Restore your DynamoDB table from a backup.
  • Use Amazon Simple Storage Service (Amazon S3) to export and import your DynamoDB table.
  • Add a replica to your DynamoDB table, and then delete your source table.

Resolution

Restore your DynamoDB table from a backup

You can use a backup to restore your DynamoDB table to a different Region. To do this, follow the instructions on Restore a DynamoDB table from a backup. When you get to the Destination AWS Region section, make sure that you select Cross-Region.

Use Amazon S3 to export and import your DynamoDB table

You can export a table from DynamoDB to Amazon S3 in one Region, and then import the table from Amazon S3 to DynamoDB in another Region.

Export a table from DynamoDB to Amazon S3

Prerequisites: Before you export a table from DynamoDB to Amazon S3, complete the following prerequisites:

  • Activate point-in-time-recovery (PITR).
  • Set up permissions that allow DynamoDB to put objects in an S3 bucket.

To export a table from DynamoDB to Amazon S3, use the AWS Management Console to request an export. When you use these instructions, make sure that you follow the steps for Full export.

Import a table from Amazon S3 to DynamoDB

Prerequisites: Before you import a table from Amazon S3 to DynamoDB, complete the following prerequisites:

  • Set up AWS Identity and Access Management (IAM) permissions that allow the IAM user or role to access DynamoDB, Amazon S3, and Amazon CloudWatch (for logging).
  • Set up S3 bucket permissions that allow read access to objects in the bucket.

To import a table from Amazon S3 to DynamoDB, use the AWS Management Console to request an import. When you get to Import file compression, make sure that you select GZIP.

Add a replica to your DynamoDB table and delete your source table

You can add a replica to your DynamoDB table to create a global table. After your tables synchronize, your replica table becomes a standalone table, and you can then delete your source table.

Prerequisite: Before you add a replica and delete your source table, verify that you have the required permissions for global tables.

To add a replica to your DynamoDB table, complete the following steps:

  1. Open the DynamoDB console.
  2. In the navigation pane, choose Tables.
  3. Select your table, and then choose Global tables.
  4. Choose Create replica.
  5. Under Replication settings, choose Eventual consistency.
  6. From the Available replication Regions dropdown list, select the Region that you want your table to be in.
  7. Choose Create.

To delete your source DynamoDB table, complete the following steps:

  1. Open the DynamoDB console.
  2. In the navigation, choose Tables.
  3. Select your table, and then choose Global tables.
  4. Under Replicas, select the Replication Region for your source table.
  5. Choose Delete replica.

Note: You can't delete a table that you used to create a replica until you wait 24 hours.

Related information

Point-in-time backups for DynamoDB

Global tables - multi-active, multi-Region replication

Best practices for global tables

AWS OFFICIALUpdated 5 months ago
2 Comments

What about if I have a very large table and I need to quickly transfer the table from a region A to another region B? Can I use GlobalTables instead? The pipeline should be the following:

  1. Update table in region A, activating streams and replica in region B
  2. After migration is done, after at least 24 hours, from region B remove replica in region A (the source table)

I do not understand if the 2nd step will only remove the source table in region A (leaving table in region B standalone, with all datas) or if it will delete all data also in region B. Please, could you explain me what it should happens?

replied 7 months ago

This approach is deprecated. When restoring backups, you can’t select a different region in the AWS Console. In my opinion, using Global Tables is the most suitable option in this case.

However, please note that you cannot delete the original table within 24 hours after enabling Global Tables.

replied 6 months ago