https://github.com/mifi/cognito-backup
CLI for backing up AWS Cogntito User Pools
https://github.com/mifi/cognito-backup
aws aws-cognito backup cloud cognito-backup user-pool user-pools
Last synced: about 1 year ago
JSON representation
CLI for backing up AWS Cogntito User Pools
- Host: GitHub
- URL: https://github.com/mifi/cognito-backup
- Owner: mifi
- License: mit
- Created: 2016-11-01T13:09:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T14:55:26.000Z (over 1 year ago)
- Last Synced: 2025-04-08T15:05:12.061Z (about 1 year ago)
- Topics: aws, aws-cognito, backup, cloud, cognito-backup, user-pool, user-pools
- Language: JavaScript
- Size: 160 KB
- Stars: 156
- Watchers: 6
- Forks: 26
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-aws - mifi/cognito-backup :fire: - Tool for backing up and restoring Cognito user pools and groups. (Open Source Repos / Cognito)
README
# cognito-backup 👫→💾
Amazon doesn't have any way of backing up their AWS Cognito User Pools and Groups.
So in my frustrating times working with AWS Cognito, I wrote this tool. `cognito-backup` is a simple CLI for backing up the user data, and can also restore afterwards. Note: AWS has no way of extracting the passwords of your users so you need to store these separately 😵
## Requirements
Requires node 12 or newer
## Install
```
npm install -g cognito-backup
```
## Usage
Backup all users in a single user pool:
`cognito-backup backup-users `
Backup all users in all user pools for this account:
`cognito-backup backup-all-users `
Restore users to a single user pool:
`cognito-backup restore-users `
Backup/export all groups in a single user pool:
`cognito-backup backup-groups `
Restore/import groups to a single user pool (Note: run this *before* restoring users)
`cognito-backup restore-groups `
Run `cognito-backup` for complete usage.
## Examples
```bash
cognito-backup backup-users eu-west-1_1_12345
cognito-backup backup-users eu-west-1_1_12345 --region eu-west-1 --file mypool.json
cognito-backup backup-all-users eu-west-1_1_12345 --region eu-west-1 --dir output
cognito-backup restore-users eu-west-1_12345 Abcd.1234 --file eu-west-1_12345.json
cognito-backup backup-groups eu-west-1_12345
cognito-backup restore-groups eu-west-1_12345
```
## Troubleshooting
Enable verbose log output:
```
DEBUG=cognito-backup cognito-backup ...
```
## Related
- https://github.com/mifi/dynamodump
- https://github.com/rahulpsd18/cognito-backup-restore