Prompt
How do I migrate customer accounts from one identity system to another?
Latest observation
Migrating customer accounts from one identity system to another is usually a project, not a script. The safest approach is to plan for account linkage + gradual cutover, because you often can’t move passwords or MFA factors directly.
1) Inventory what must move
List every identity-related object and dependency:
- User profile data: name, email, phone, locale, addresses, consent flags
- Authentication data:
- password hashes
- MFA methods
- recovery codes
- social login identities
- passkeys / WebAuthn credentials
- Authorization data:
- roles, groups, permissions, entitlements
- Account state:
- verified email/phone status
- locked/suspended status
- password reset state
- App dependencies:
- session tokens
- refresh tokens
- API keys
- linked devices
- Compliance/audit requirements:
- login history
- consent records
- deletion requests
- retention obligations
2) Decide your migration pattern
Common options:
A. Bulk migration
Export users from the old system and import them into the new one.
Good for: simple user stores, low security sensitivity, manageable downtime
Risk: password hashes may not be compatible; MFA usually won’t transfer cleanly
B. Just-in-time migration
Keep old auth in place temporarily. When a user logs in, verify them against the old system, then create/update the account in the new system.
Good for: large consumer bases, minimal disruption
Benefit: avoids forcing password resets for everyone at once
C. Account linking / federation
Use the new system as the front door, but delegate authentication to the old system initially (OIDC/SAML/LDAP/custom bridge), then gradually migrate users.
Good for: enterprise or complex environments
Benefit: smoother transition and lower user friction
3) Handle passwords carefully
Passwords are usually the hardest part.
- If both systems support the same password hashing algorithm and parameters, you may be able to migrate hashes directly.
- If not, use just-in-time migration:
- User enters password on new system
- New system sends credentials to old system for validation
- If valid, new system stores a new hash and takes over
- If you can’t validate against the old system, you’ll need a password reset campaign.
Never try to “decrypt” passwords unless your old system actually used reversible encryption, which is generally a bad practice.
4) Plan for MFA and passkeys
These are often not portable.
- TOTP: usually can’t be copied safely; users may need to re-enroll
- SMS/email MFA: may be re-created if numbers/emails are retained
- WebAuthn/passkeys: generally tied to the relying party; expect re-registration
- Backup codes: usually regenerate in the new system
A common pattern is:
- migrate the account
- keep email/password access working
- require MFA re-enrollment on first login or within a transition window
5) Map identities and avoid duplicates
Create a clear identity-matching strategy:
- Primary key: external user ID if available
- Secondary keys: verified email, phone number, legacy account number
- Build rules for:
- one-to-one matches
- merges
- conflicts
- duplicates
- orphaned accounts
Maintain an identity crosswalk table:
- old_user_id → new_user_id
- old_auth_provider → new_auth_provider
- migration status
- timestamp
- reconciliation notes
6) Migrate authorization separately from authentication
Authentication says “who are you?”
Authorization says “what can you do?”
Do not assume roles/groups translate automatically. Review:
- role names
- permission granularity
- org membership
- tenant structure
- admin privileges
Test edge cases like:
- suspended users
- users with multiple roles
- service accounts
- delegated access
7) Preserve audit and compliance records
If you need historical traceability:
- export login events
- keep consent timestamps
- preserve password-change dates if relevant
- keep account creation and deletion history
- verify data processing agreements if crossing vendors/regions
8) Build a phased rollout
A safe rollout often looks like this:
- Pilot with internal users
- Migrate a small customer cohort
- Monitor login success, reset rates, support tickets
- Expand in waves
- Enable fallback to old auth during transition
- Freeze new signups in the old system at cutover
- Decommission old system only after all users and integrations are moved
9) Test like a hostile environment
Test:
- successful login
- wrong password
- account lockout
- MFA enrollment and recovery
- password reset
- email change
- duplicate identity resolution
- session invalidation
- API clients and mobile apps
- federated login edge cases
Also test failure modes:
- old system unavailable
- partial migration
- duplicate records
- stale sessions
- token incompatibility
10) Communicate clearly to customers
Users should know:
- what is changing
- whether they need to do anything
- whether passwords will work as-is
- whether MFA must be re-enrolled
- when old login will stop working
- how to get help
Minimize surprise with:
- email notices
- in-product banners
- FAQ/help docs
- support scripts
11) Cut over safely
On cutover day:
- freeze writes in old system if possible
- run final sync
- invalidate old sessions/tokens
- switch login routing
- monitor authentication errors, resets, and support volume
- keep rollback plan ready
12) Common pitfalls
- trying to migrate passwords without compatible hashes
- forgetting service accounts or machine-to-machine credentials
- losing group/role mappings
- breaking SSO integrations
- not handling email aliases and duplicate accounts
- forgetting to invalidate old sessions
- underestimating support load
- decommissioning the old system too early
Practical rule of thumb
If you want the least user disruption, use:
- just-in-time migration for passwords
- re-enrollment for MFA/passkeys
- crosswalk mapping for identities and roles
- phased cutover with rollback
If you want, I can also provide:
- a step-by-step migration plan,
- a database mapping template, or
- an example for a specific platform like Auth0, Okta, Azure AD B2C, Cognito, Keycloak, or a custom IAM.