Prompt
How do I migrate users from an old login system to a new CIAM?
Latest observation
Migrating users from an old login system to a new CIAM usually means moving identity records, login credentials, and account recovery paths without breaking sign-in for existing users. The exact approach depends on how much control you have over the old system and how much user friction you can tolerate.
1) Pick a migration pattern
A. Bulk import + password reset
Use this if you can export users but can’t safely migrate passwords.
- Export user profiles from the old system
- Import into the CIAM
- Mark passwords as unavailable/untrusted
- Force users to set a new password on first login or via email reset
Pros: Simple, secure
Cons: More user friction
B. Password hash migration
Use this if the old system stores password hashes you can legally and technically migrate.
- Export password hashes and metadata
- Import into CIAM if it supports the same hash algorithm/parameters
- On first successful login, rehash into the new system’s preferred scheme
Pros: Smooth transition
Cons: Only works if CIAM supports the old hash format or a custom auth bridge
C. Just-in-time migration
Use this if you want a seamless experience and can still authenticate against the old system.
- User logs in to the new CIAM
- CIAM checks old system credentials if the user isn’t yet migrated
- If valid, CIAM creates the new account and stores the new credential state
- Future logins use the CIAM only
Pros: Minimal user disruption
Cons: Requires the old auth system to remain available during the transition
D. Federated migration
Use this if the old system can act as an identity provider or supports SSO.
- Set up federation between old and new systems
- Gradually switch apps to trust the new CIAM
- Migrate users opportunistically
Pros: Good for phased rollout
Cons: More architecture complexity
2) Inventory what needs to move
Typical user data categories:
- Identity profile: name, email, phone, locale, timezone
- Credentials: password hash, MFA methods, recovery codes
- Verification state: email/phone verified flags
- Consent and preferences: marketing opt-in, terms acceptance
- App-specific attributes: roles, groups, subscription state
- Audit history: login timestamps, last password change
- Linked identities: social login, enterprise SSO links
Not everything should necessarily be migrated. For example, old recovery codes are often better regenerated.
3) Decide how to handle passwords
This is usually the hardest part.
Best case
If your CIAM supports:
- the old hash algorithm,
- the old salt/rounds parameters,
- and custom verification hooks,
then you can migrate hashes and rehash on next login.
If not
Use one of these:
- password reset at first login
- just-in-time migration with the old system validating passwords
- temporary dual-auth period
Avoid trying to reverse hashes or transfer plain-text passwords. That’s insecure and usually impossible.
4) Plan account matching carefully
You need a reliable way to map old users to new users:
- primary email
- phone number
- old user ID stored as a custom attribute
- identity provider subject ID
Watch out for:
- duplicate emails
- shared emails
- users who changed email
- unverified emails in the old system
A safe pattern is:
- create a stable
legacy_user_id - store it in the new CIAM as an immutable custom claim/attribute
- use that for reconciliation and support
5) Migrate in phases
A common rollout plan:
Phase 1: Prepare
- clean up old user data
- normalize emails and phone numbers
- identify inactive/disabled accounts
- define mapping rules
- test migration in a staging environment
Phase 2: Pilot
- migrate a small internal or beta cohort
- validate login, MFA, account recovery, and profile data
- monitor error rates and support tickets
Phase 3: Progressive rollout
- migrate by cohort: employees, active users, then long-tail users
- use just-in-time migration for stragglers if possible
Phase 4: Cutover
- freeze writes to old system
- disable new registrations there
- redirect auth flows to the CIAM
- keep old system read-only for a period as a fallback
Phase 5: Decommission
- archive data per retention policy
- revoke secrets/keys
- shut down old auth dependencies
6) Preserve security controls
During migration, make sure you don’t weaken security:
- enforce MFA enrollment policies in the new CIAM
- confirm session tokens are not reused across systems
- rotate secrets and signing keys if needed
- validate email/phone before re-enabling account recovery
- log all migration events for auditability
- rate-limit login attempts during dual-auth/JIT migration
7) Handle edge cases
Plan for:
- users with no verified email
- duplicated accounts
- social-only accounts
- accounts with pending invites
- locked, disabled, or deleted accounts
- service accounts vs human users
- customers under different regional privacy rules
You may need a manual remediation workflow for a small subset of users.
8) Test the important journeys
Test these end-to-end:
- first login after migration
- password reset
- MFA enrollment and challenge
- email/phone change
- account recovery
- social login link/unlink
- SSO login
- account lockout / unlock
- profile sync to downstream apps
9) Communicate clearly to users
If users will notice anything, tell them:
- what’s changing
- whether they need to reset passwords
- whether MFA will need re-enrollment
- when the change happens
- where to get help
Good communication reduces support load.
10) A practical default approach
If you want a safe, common default:
- Export user profiles and verified identifiers
- Import into CIAM with a
legacy_user_id - Keep the old auth system available temporarily
- Use just-in-time migration for password validation
- Rehash passwords into CIAM on successful login
- Force password reset for users who never log in during the migration window
- Re-enroll MFA where needed
- Retire the old system after a defined grace period
If you want, I can also give you:
- a step-by-step migration runbook
- a data mapping checklist
- or a reference architecture for JIT password migration into a CIAM like Okta, Auth0, Azure AD B2C, or Cognito.