{"id":13941341,"url":"https://github.com/yegor256/dynamo-archive","last_synced_at":"2025-04-04T13:04:59.236Z","repository":{"id":57217772,"uuid":"10433767","full_name":"yegor256/dynamo-archive","owner":"yegor256","description":"Archive and Restore DynamoDB Tables, from the Command Line","archived":false,"fork":false,"pushed_at":"2025-03-27T07:03:17.000Z","size":490,"stargazers_count":102,"open_issues_count":14,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T20:06:56.065Z","etag":null,"topics":["amazon-dynamo","amazon-dynamodb","archive","aws","backup","dynamodb","javascript","json"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dynamo-archive","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-02T07:13:10.000Z","updated_at":"2025-03-27T07:03:20.000Z","dependencies_parsed_at":"2024-02-26T23:44:20.232Z","dependency_job_id":"597a6d1e-bbdd-434f-b70c-2553fe712c10","html_url":"https://github.com/yegor256/dynamo-archive","commit_stats":{"total_commits":113,"total_committers":14,"mean_commits":8.071428571428571,"dds":0.6283185840707964,"last_synced_commit":"aacca7426115bcdde690ebd291cc7ac69cf7228b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fdynamo-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fdynamo-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fdynamo-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fdynamo-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/dynamo-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247177202,"owners_count":20896602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-dynamo","amazon-dynamodb","archive","aws","backup","dynamodb","javascript","json"],"created_at":"2024-08-08T02:01:16.895Z","updated_at":"2025-04-04T13:04:59.197Z","avatar_url":"https://github.com/yegor256.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/dynamo-archive)](http://www.rultor.com/p/yegor256/dynamo-archive)\n\n[![npm](https://github.com/yegor256/dynamo-archive/actions/workflows/npm.yml/badge.svg)](https://github.com/yegor256/dynamo-archive/actions/workflows/npm.yml)\n[![NPM version](https://badge.fury.io/js/dynamo-archive.svg)](http://badge.fury.io/js/dynamo-archive)\n\nThere are two simple Node.js scripts that archive and restore an entire\n[AWS Dynamo DB](http://aws.amazon.com/dynamodb/)\ntable in JSON format.\n\nInstall it first (I assume you have\n[Node.js](http://nodejs.org/) and\n[Npm](https://npmjs.org/doc/install.html) installed already):\n\n```bash\n$ npm install -g dynamo-archive\n```\n\nCreate a user in [Amazon IAM](http://aws.amazon.com/iam/)\nand assign a policy to it ([how?](http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html)):\n\n```json\n{\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\"dynamodb:Scan\", \"dynamodb:DescribeTable\"],\n      \"Resource\": \"arn:aws:dynamodb:us-east-1:019644334823:table/test\"\n    }\n  ]\n}\n```\n\nWhere `019644334823` if your AWS account number, `us-east-1` is AWS region,\nand `test` is the name of your Dynamo DB table (can be a `*`, if you grant\naccess to all tables).\n\nRun it first without arguments and read the output:\n\n```bash\n$ dynamo-archive.js\n```\n\nTo restore a table from a JSON file run:\n\n```bash\n$ dynamo-restore.js\n```\n\n## Crontab automation\n\nI'd recommend to use this simple bash script to automate backups\nof your Dynamo DB tables and save them to S3 (I'm using [s3cmd](http://s3tools.org/s3cmd)):\n\n```bash\n#/bin/bash\n\nAWS_ACCESS_KEY_ID=AKIAJK.......XWGA5AA\nAWS_SECRET_ACCESS_KEY=7aDUFa68GN....................IGcH0zTf3k\n#optional endpoint for DynamoDB local\nAWS_DYNAMODB_ENDPOINT=http://localhost:8000/\ndeclare -a TABLES=(first second third)\nfor t in ${TABLES[@]}\ndo\n  dynamo-archive/bin/dynamo-archive.js --table=$t \u003e $t.json\n  s3cmd --no-progress put $t.json s3://backup.example.com/dynamo/$t.json\n  rm $t.json\ndone\n```\n\n## How to contribute\n\nRead [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nMake sure your build is green before you contribute\nyour pull request. You will need to have NodeJS and installed. Then:\n\n```\n$ npm install\n$ npm test\n```\n\nIf it's clean and you don't see any error messages, submit your pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fdynamo-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fdynamo-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fdynamo-archive/lists"}