Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying one table to another in DynamoDB

What's the best way to identically copy one table over to a new one in DynamoDB?

(I'm not worried about atomicity).

like image 921
ensnare Avatar asked Sep 03 '12 01:09

ensnare


People also ask

How do I transfer data from one DynamoDB account to another?

You can migrate your DynamoDB tables to a different AWS account by doing the following: Export the DynamoDB table data into an Amazon Simple Storage Service (Amazon S3) bucket in the other account. Use an AWS Glue job to import the data.

How do I export a whole DynamoDB table?

To export a DynamoDB table, you use the AWS Data Pipeline console to create a new pipeline. The pipeline launches an Amazon EMR cluster to perform the actual export. Amazon EMR reads the data from DynamoDB, and writes the data to an export file in an Amazon S3 bucket.

How does replication work in DynamoDB?

DynamoDB Global Tables allows deploying a multi-region, multi-master DynamoDB replication solution. It is a fully-managed solution, where users need not write any custom code to make changes to data. DynamoDB automatically updates the data before replicating it across different regions.


2 Answers

Create a backup(backups option) and restore the table with a new table name. That would get all the data into the new table. Note: Takes considerable amount of time depending on the table size

like image 193
Saisumanth Gopisetty Avatar answered Sep 28 '22 16:09

Saisumanth Gopisetty


I just used the python script, dynamodb-copy-table, making sure my credentials were in some environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY), and it worked flawlessly. It even created the destination table for me.

python dynamodb-copy-table.py src_table dst_table

The default region is us-west-2, change it with the AWS_DEFAULT_REGION env variable.

like image 39
Rohmer Avatar answered Sep 28 '22 17:09

Rohmer