node package manager


Made By DevOps By

Build Status NPM version Dependency Status

Archive and Restore AWS Dynamo DB Table

There are two simple Node.js scripts that archive and restore an entire AWS Dynamo DB table in JSON format.

Install it first (I assume you have node.js and npm installed already):

$ npm install dynamo-archive

Create a user in Amazon IAM and assign a policy to it (how?):

  "Statement": [
      "Effect": "Allow",
      "Action": ["dynamodb:Scan", "dynamodb:DescribeTable"],
      "Resource": "arn:aws:dynamodb:us-east-1:019644334823:table/test"

Where 019644334823 if your AWS account number, us-east-1 is AWS region, and test is the name of your Dynamo DB table (can be a *, if you grant access to all tables).

Run it first without arguments and read the output:

$ ./bin/dynamo-archive.js

To restore a table from a JSON file run:

$ ./bin/dynamo-restore.js

Crontab automation

I'd recommend to use this simple bash script to automate backups of your Dynamo DB tables and save them to S3 (I'm using s3cmd):

#optional endpoint for DynamoDB local
declare -a TABLES=(first second third)
for t in ${TABLES[@]}
  dynamo-archive/bin/dynamo-archive.js --table=$t > $t.json
  s3cmd --no-progress put $t.json s3://$t.json
  rm $t.json


Licensed under the Apache License, Version 2.0.

Bitdeli Badge