Export data from DynamoDB

后端 未结 17 1824
离开以前
离开以前 2020-12-13 04:02

Is it possible to export data from DynamoDB table in some format?

The concrete use case is that I want to export data from my production dynamodb database and import

相关标签:
17条回答
  • 2020-12-13 04:20

    Dynamo DB now provides a way to export and import data to/from S3 http://aws.amazon.com/about-aws/whats-new/2014/03/06/announcing-dynamodb-cross-region-export-import/

    0 讨论(0)
  • 2020-12-13 04:21

    I have created a utility class to help developers with export. This can be used if you don't want to use data-pipeline feature of AWS. Link to git hub repo is -here

    0 讨论(0)
  • 2020-12-13 04:24

    I think my answer is more similar to Ivailo Bardarov , if planning to run this from linux instance run this

    1.Login to your AWS account and go to IAM to create a user with limited policy for a role(for security purpose of course). This should be only limited to read dynamodb table that you would like to backup.

    2.Copy the access key and secret and update below command to run it on Linux (but make sure your table is not huge and possibly creating a space issue for the box you are running this on)

    AWS_ACCESS_KEY_ID='put_your_key' AWS_SECRET_ACCESS_KEY='put_your_secret' aws --region='put_your_region' dynamodb scan --table-name 'your_table_name'>> export_$(date "+%F-%T").json
    

    Note similar command can be executed on Windows/Powershell I have not tested so I'm not adding it here.

    0 讨论(0)
  • 2020-12-13 04:24

    I used the awesome cyberchef site... https://gchq.github.io/CyberChef

    With the csv to json tool.

    0 讨论(0)
  • 2020-12-13 04:25

    For those of you that would rather do this using java, there is DynamodbToCSV4j.

    JSONObject config = new JSONObject();
    config.put("accessKeyId","REPLACE");
    config.put("secretAccessKey","REPLACE");
    config.put("region","eu-west-1");
    config.put("tableName","testtable");
    d2csv d = new d2csv(config);
    
    0 讨论(0)
  • 2020-12-13 04:32

    In DynamoDB web console select your table, than Actions -> Export/Import

    0 讨论(0)
提交回复
热议问题