You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
$ dynamo-archive.js
To restore a table from a JSON file run:
$ 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):
#/bin/bash
AWS_ACCESS_KEY_ID=AKIAJK.......XWGA5AA
AWS_SECRET_ACCESS_KEY=7aDUFa68GN....................IGcH0zTf3k
#optional endpoint for DynamoDB local
AWS_DYNAMODB_ENDPOINT=https://localhost:8000/
declare -a TABLES=(first second third)
fortin${TABLES[@]}do
dynamo-archive/bin/dynamo-archive.js --table=$t>$t.json
s3cmd --no-progress put $t.json s3://backup.example.com/dynamo/$t.json
rm $t.json
done
How to contribute
Read these guidelines.
Make sure your build is green before you contribute
your pull request. You will need to have NodeJS and installed. Then:
$ npm install
$ npm test
If it's clean and you don't see any error messages, submit your pull request.
About
Archive and Restore DynamoDB Tables, from the Command Line