{"id":32957348,"url":"https://github.com/rahulpsd18/cognito-backup-restore","last_synced_at":"2026-01-14T13:30:27.058Z","repository":{"id":32619533,"uuid":"138120460","full_name":"rahulpsd18/cognito-backup-restore","owner":"rahulpsd18","description":"AIO Tool for backing up and restoring AWS Cognito User Pools","archived":false,"fork":false,"pushed_at":"2023-03-09T13:31:48.000Z","size":3714,"stargazers_count":201,"open_issues_count":22,"forks_count":65,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-11-16T15:05:33.021Z","etag":null,"topics":["amazon-cognito","aws","aws-cognito","backup","backup-cli","cognito","cognito-user-pool","restore","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahulpsd18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"custom":["https://www.paypal.me/rahulpsd18"]}},"created_at":"2018-06-21T04:47:54.000Z","updated_at":"2025-09-18T12:49:25.000Z","dependencies_parsed_at":"2024-01-02T21:57:50.852Z","dependency_job_id":"b9c3f9a0-165c-4dc3-aa76-d57d4d6cda10","html_url":"https://github.com/rahulpsd18/cognito-backup-restore","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/rahulpsd18/cognito-backup-restore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulpsd18%2Fcognito-backup-restore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulpsd18%2Fcognito-backup-restore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulpsd18%2Fcognito-backup-restore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulpsd18%2Fcognito-backup-restore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahulpsd18","download_url":"https://codeload.github.com/rahulpsd18/cognito-backup-restore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulpsd18%2Fcognito-backup-restore/sbom","scorecard":{"id":759086,"data":{"date":"2025-08-11","repo":{"name":"github.com/rahulpsd18/cognito-backup-restore","commit":"2cf6c47feef4c1cb1da5b22c180e02b909d0e779"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":3,"reason":"Found 3/8 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T22:44:50.393Z","repository_id":32619533,"created_at":"2025-08-22T22:44:50.393Z","updated_at":"2025-08-22T22:44:50.393Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-cognito","aws","aws-cognito","backup","backup-cli","cognito","cognito-user-pool","restore","typescript"],"created_at":"2025-11-12T23:00:22.449Z","updated_at":"2026-01-14T13:30:27.030Z","avatar_url":"https://github.com/rahulpsd18.png","language":"TypeScript","funding_links":["https://www.paypal.me/rahulpsd18"],"categories":["Open Source Repos"],"sub_categories":["Cognito"],"readme":"# cognito-backup-restore\n[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors)\n\nAIO Tool for backing up and restoring AWS Cognito User Pools\n\nAmazon Cognito is awesome, but has its own set of limitations. Currently there is no backup option provided in case we need to take backup of users (to move to another service) or restore them to new Userpool.\n\n`cognito-backup-restore` tries to overcome this problem by providing a way to backup users from cognito pool(s) to json file and vice-versa.\n\n\u003e **Please Note:** *There is no way of getting passwords of the users in cognito, so you may need to ask them to make use of ForgotPassword to recover their account.*\n\n\n## Requirements\n\nRequires node 6.10 or newer\n\n## Installation\n\n`cognito-backup-restore` is available as a package on [npm](https://www.npmjs.com/package/cognito-backup-restore).\n\n```shell\nnpm install -g cognito-backup-restore\n```\n\n## Usage\n\n`cognito-backup-restore` can be used by importing it directly or via [CLI](#cli) (recommended).\n\n### Imports\n\nMake sure you have installed it locally `npm install --save cognito-backup-restore`. Typings are available and included.\n\n```typescript\nimport * as AWS from 'aws-sdk';\nimport {backupUsers, restoreUsers} from 'cognito-backup-restore';\n\nconst cognitoISP = new AWS.CognitoIdentityServiceProvider();\n\n// you may use async-await too\nbackupUsers(cognitoISP, \u003cUSERPOOL-ID\u003e, \u003cdirectory\u003e)\n  .then(() =\u003e console.log(`Backup completed`))\n  .catch(console.error)\n\nrestoreUsers(cognitoISP, \u003cUSERPOOL-ID\u003e, \u003cJSON-File\u003e, \u003cPassword?\u003e)\n  .then(() =\u003e console.log(`Restore completed`))\n  .catch(console.error)\n```\n\nThis is useful incase you want to write your own wrapper or script instead of using CLI.\n\n\n### CLI\nRun `cognito-backup-restore` or `cbr` to use it. Make use of `-h` for help.\n\n```shell\ncbr \u003ccommand\u003e [options]\n```\n\n\u003e Available options are:\n\u003e\n\u003e `--region` `-r`: The region to use. Overrides config/env settings\n\u003e\n\u003e `--userpool` `--pool`: The Cognito pool to use. Possible value of `all` is allowed in case of backup.\n\u003e\n\u003e `--profile` `-p`: Use a specific profile from the credential file. Key and Secret can be passed instead (see below).\n\u003e\n\u003e `--aws-access-key` `--key`: The AWS Access Key to use. Not to be passed when using `--profile`.\n\u003e\n\u003e `--aws-secret-key` `--secret`: The AWS Secret Key to use. Not to be passed when using `--profile`.\n\u003e\n\u003e `--delay`: delay in millis between alternate users batch(60) backup, to avoid rate limit error.\n\u003e\n\u003e `--use-env-vars`: Use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN (optional) as environment variables\n\u003e\n\u003e `--use-ec2-metadata`: Use credentials received from the metadata service on an EC2 instance\n\n![Image showing CLI Usage](gifs/demo.png \"CLI Usage\")\n\n- **Backup**\n  ```shell\n  cbr backup\n  cbr backup \u003coptions\u003e\n  ```\n  `--directory` option is available to export json data to.\n\n  ![GIF for using Backup CLI](gifs/backup-min.gif \"Backup Demo\")\n\n- **Restore**\n  ```shell\n  cbr restore\n  cbr restore \u003coptions\u003e\n  ```\n  `--file` option is available to read the json file to import from.\n\n  `--pwd` option is available to set TemporaryPassword of the users. If not provided, cognito generated password will be used and email will be sent to the users with One Time Password.\n\n  `--pwdModule` option is available to make use of custom logic to generate password. If not provided, cognito generated password will be used and email will be sent to the users with One Time Password, unless `--pwd` is used. Make sure to pass absolute path of the file. Refer [this](https://github.com/rahulpsd18/cognito-backup-restore/pull/1).\n\n  ![GIF for using Restore CLI](gifs/restore-min.gif \"Restore Demo\")\n\n**In case any of the required option is missing, a interactive command line user interface kicks in to select from.**\n\n## Todo\n\n- [X] ~~Fine tune the backup process~~\n- [X] ~~Implement Restore~~\n- [X] ~~Write detailed Readme with examples~~\n- [ ] Convert JSON to CSV\n- [ ] Implement Amazon Cognito User Pool Import Job\n- [ ] AWS Cross-Region Cognito Replication\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/adityamedhe-cc\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/30614870?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eadityamedhe-cc\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=adityamedhe-cc\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=adityamedhe-cc\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/juno-visualsquares\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/18159739?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ejuno-visualsquares\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=juno-visualsquares\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-juno-visualsquares\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.carbonatethis.com\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1521394?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCharlie Brown\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/issues?q=author%3Acarbonrobot\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://gardlabs.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/32401961?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlvaro Del Valle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#question-alvarodelvalle\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://blog.v-lad.org\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/36257?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVlad Korolev\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=vladistan\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ashishkujoy\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/34642693?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eashish kumar \u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=ashishkujoy\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=ashishkujoy\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://qiita.com/ufoo68\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/24458640?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eufoo68\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=ufoo68\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/steveizzle\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/45331237?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003esteveizzle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=steveizzle\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=steveizzle\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.paralleltheory.com/\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/71354?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eM. Holger\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/rahulpsd18/cognito-backup-restore/commits?author=mholger\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulpsd18%2Fcognito-backup-restore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulpsd18%2Fcognito-backup-restore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulpsd18%2Fcognito-backup-restore/lists"}