DEV Community

Cover image for How to use DynamoDB data import
Masayoshi Haruta for AWS Community Builders

Posted on

How to use DynamoDB data import

Introduction

Last month updated, DynamoDB has provided a data import feature🎉 (Reference). New tables can be created by importing data in S3 buckets.

The data export to S3 has been available so far, but now import is finally possible, and the combination of the two makes it possible to create and restore backups easily and conveniently!

I used this feature this time because I needed to redesign the DynamoDB partition key and sort key, and it was very useful. I know that many people have written scripts for data import when recreating Dynamo (I did too), but from now on, scripts are no longer necessary😎!

Please refer to the following instructions💡

How to use

1. Export data to S3

Firstly, I export data to an S3 bucket. So I access the DynamoDB table and use the Export to S3 feature.

1

Set your S3 bucket and wait for the executed.

2

Done!

3

2. Import data from S3

Now, I do the import feature using the exported data. Access to the "Imports from S3" menu from left side menu.

4

Set the import data information. Please note that S3 Exported data will be GZIP and JSON format by default.

5

Note that as for Source S3 URL, the imported data resides in the bucket's data directory, so the URL selection should be set the data directory.
6

Determine the table name, partition key, etc. to be imported.
7

Table settings can also be selected.(I set default here)
8

If all is well, press the Import button to execute.
9

Done!
10

3. Confirm the result

I have successfully confirmed that the table exists!
11

I also looked at it from NoSQL Workbench! I can confirm that the metadata is set correctly, including the various keys I have set.
12

Conclusion

Import function, extremely useful🤣🤣🤣
It would be very good when restoring from backups, recreating key settings, etc.😇😇😇

Thank you for reading!

Top comments (0)