- Hi, my name is Vaibhav Bhardwaj,
and I'm Senior DynamoDB Specialist Solutions Architect
at Amazon Web Services.
In this demo, I'll demonstrate how to use Amazon DynamoDB
export to S3 and import to S3 feature
to migrate your Amazon DynamoDB table between AWS account.
I've already published a detailed video
that outlines at least four different methods
of migrating DynamoDB tables between AWS account.
I've published that video
with the same DynamoDB Nuggets playlist.
I will strongly recommend you to watch that video first
and then join me in this demo.
Let's start by creating an S3 bucket in destination account.
Click on Create Bucket.
Choose the region of your choice
and provide the name for this bucket.
You can keep rest of the settings as default
and click on Create Bucket.
Now we will allow the source account
to perform S3 put object operations in this bucket.
We will achieve this by applying a bucket policy
to this S3 bucket.
This is the bucket policy that allows
S3 put object operations from source account to this bucket.
Make sure you include the AWS account ID
of source account correctly.
Click on Save Changes.
Let's go to source account
and export the data from DynamoDB table
to this S3 bucket in destination account.
In DynamoDB console, select the source table
and click on Exports and Streams.
Click on Export to S3.
Please note you must turn on point-in-time restore feature
of DynamoDB to export data to S3.
This can be done by doing just a single click here.
Also understand there are additional charges
for enabling point-in-time restore,
and once enabled, you can disable it anytime.
Now enter the name of the destination S3 bucket here,
and also mention that this bucket belongs
to other AWS account.
You can keep rest of the settings as default
and click on Export.
Depending on how much data you have in your table,
it can take some time to export this data.
I have fast forwarded the video
and you can see that the data is exported to S3.
Let's go to the S3 bucket and destination account
and see if you are able to see the exported data.
You might need to refresh the page.
We can see a folder with name AWS DynamoDB,
and if we go under it, we see some sub-folders,
and we see a folder named Data
where we can see the exported data files
in GZIP JSON format.
Let's try to restore this data in S3 bucket
to a new DynamoDB table.
For that, we will go to DynamoDB console
and click on Imports From S3.
Click on Browse S3
and choose the S3 bucket where the data has been exported.
You will need to browse
through all the sub folders till you find the data directory
containing GZIP JSON files.
Select this data folder and click on Choose.
Our files are GZIP compressed
and are in DynamoDB JSON format,
so we'll select these options accordingly.
On the next screen, input the name of the new DynamoDB table
where data will be restored.
Provide the same partition key
and sort key as a source table and click on Next.
Under Configure Table Settings,
you can choose options like provision capacity or on demand.
For this demo, we will choose on demand mode
and click on Next.
Review the settings and click on Import.
It can take some time for this import job to finish.
You can check its status here
or click on the import ID to see the details of this job.
I have fast forwarded the video,
and you can see that our job is completed successfully.
Let's check if we are able to see any data in restore table.
Click on the table name.
And you can see this table has imported data.
Let's go in source account and check the table.
There we can see
that the source table also has two items.
This confirms we are able to migrate our DynamoDB table
between AWS accounts using DynamoDB export to S3
and import from S3 feature.
Thanks for watching the demo. I hope you found it useful.
Do let us know in the comments section about
what other different topics on which you would like
to see upcoming DynamoDB Nuggets videos.
Thank you.