What moves where
Cognito is doing two jobs: authenticating users, and storing their attributes. Databunker Pro replaces only the second.Before you start
- A running Databunker Pro instance and a root or admin access token.
- A license whose record cap covers your user count.
- AWS credentials with
cognito-idp:ListUserson the pool. pip install databunkerpro boto3- Your replacement auth layer built and tested, but not yet live.
No mapping table needed
Unlike a SQL users table migration, there is nothing here to keep in step with the vault. Cognito’ssub goes into the indexed custom field, so any user can be resolved directly:
Step 1: Export and import
ListUsers returns at most 60 users per page and is throttled, so the export is usually the slow part — not the import. The script runs in two phases: page through the whole pool first, then import the result in chunks of 1,000 via UserCreateBulk.
Cognito returns attributes as a list of name/value pairs, so they are flattened first, then mapped onto the fields Databunker Pro indexes:
Everything else is carried across unchanged, including
custom:* attributes.
Cognito allows two accounts to hold the same email when the pool is not configured to require uniqueness. Databunker Pro enforces uniqueness per tenant, so the second one is rejected with
Duplicate email value and appears in cognito-errors.csv. Decide which account survives before cutting over.Groups
If you use Cognito groups, export them separately —ListUsersInGroup per group is far cheaper than one AdminListGroupsForUser call per user:
Step 2: Verify
1
Counts match
SystemGetSystemStats — totalnumrecords should have grown by the pool’s user count, less anything in cognito-errors.csv.2
Spot-check detokenization
sub went into custom, any user resolves by their Cognito id directly.3
Re-run to catch stragglers
Users created in Cognito while the export was running will have been missed. Re-run the script — already-migrated records come back as
Duplicate custom value in the error CSV, and only the new ones are added.Step 3: Cut over authentication
This is the step that affects users, so it is worth staging.1
Point the new auth layer at Databunker Pro
Sign-in looks the user up by email, reads the profile from the vault by token, and issues your own session. No Cognito call remains in the path.
2
Trigger the password reset
Email every user a one-time reset link. Send in waves rather than all at once, so support load and email-reputation damage stay manageable.
3
Keep Cognito readable during the transition
Leave the pool in place but stop writing to it. If something is missing you can still read it, and users who have not reset yet can be identified from
cognito_status in their vault profile.Step 4: Decommission the pool
Once the reset campaign has run its course and Cognito has served no sign-ins for a full business cycle, delete the user pool.Working with the vault afterwards
The calls that replace the Cognito operations you were making before. Every one of the four indexed fields —email, phone, login, custom — works as a lookup key, so you rarely need the token itself.
Sign-in: look a user up by email
AdminGetUser. The same call works with "phone", "login", or "custom" — use custom when you hold the Cognito sub:
AdminUpdateUserAttributes. Only the fields you pass are changed.
Delete a user (right to erasure)
AdminDeleteUser — but unlike Cognito this erases the personal data itself, since it lived only in the vault. The audit trail records the deletion without retaining the data.
Check whether someone exists, without reading their data
Rolling back
Next steps
- Migrate a SQL users table — if application data also lives in your own database
- Licensing and limits — what counts as a record
- AWS Cognito vs Databunker Pro — the architecture this migration lands on