Bobcares

Migrate DynamoDB Tables from one AWS account to another

by | Aug 25, 2021

Want to Migrate DynamoDB Tables from one AWS account to another? We can help you.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see how we can perform this.

 

Migrate DynamoDB Tables from one AWS account to another

We can migrate the DynamoDB tables to a different AWS account by doing the following:

  1. Export the DynamoDB table data into an Amazon S3 bucket in the other account.
  2. Use an AWS Glue job to import the data.

In addition, we can use the AWS Data Pipeline or Amazon EMR to move DynamoDB tables to another AWS account.

 

Amazon S3 and AWS Glue

It is possible to migrate the DynamoDB table to a different AWS account using an Amazon S3 bucket and an AWS Glue job.

1. For the initial migration of the DynamoDB table we export the tables to an Amazon S3 bucket in the other account.

When you export your tables from Account A to an S3 bucket in Account B, the objects are still owned by Account A.

To solve this, we include the PutObjectAcl permission on all exported objects once the export is complete.

2. We use a Glue job to read the files from the S3 bucket and write them to the target DynamoDB table.

3. Once we export the tables, we use DynamoDB streams and AWS Lambda to migrate the data insertions and updates in the source table to the destination table in another account.

 

Amazon EMR

With Amazon EMR, we have two options, depending on the use case:

1. If we can afford downtime during the migration, then we stop write operations to the source table.

This is to assure that the target table is in sync with the source table.

2. If we can’t afford downtime, then we store all transactions that happen during the migration in a staging table.

Once the migration is done, we push the new transactions from the staging table to the target table.

To migrate a DynamoDB table using Amazon EMR:
  1. In both source and destination accounts, we launch EMR clusters. In the Software configuration section, we need to include Apache Hive.
  2. The EMR_EC2_DefaultRole IAM roles in both accounts should have permission to write to the S3 bucket in the destination account.
  3. In the source account, we connect to the master node via SSH.
  4. Then, we use Hive commands to export data to the S3 bucket in the destination account.
  5. In there, we import the Amazon S3 data to the new DynamoDB table.

[Stuck with the procedures? We’d be happy to assist]

 

Conclusion

In short, we saw how our Support Techs go about the migration of DynamoDB Tables from one AWS account to another.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.