Just-in-time user migration into Zitadel

Moving users into Zitadel as they log in, instead of in one batch, lets a team keep the legacy store running until the last active account has moved. This page explains what maps, which documented paths exist, and what drives effort.

On this page

Why teams choose just-in-time user migration into Zitadel

Teams choose just-in-time user migration when a legacy identity system has to be retired but its users cannot all move at once, usually because password hashes cannot be exported or the old store must keep serving logins while applications are repointed. Instead of a single batch import, each user is moved the first time they sign in: Zitadel checks the legacy system for that user, creates the account if it is missing, and the old credential is retired once the new one exists. Zitadel documents just-in-time migration as one of its migration approaches (see its migration guides), so the pattern is supported, but the exact design depends on what the legacy system will allow.

The effort depends on three things you should establish before planning: whether the source system lets you verify a password or retrieve a hash at login, how many applications authenticate against it, and which login paths exist (web sign-in, mobile, API clients, machine clients and any federated or SSO entry points). A source that exposes a verification endpoint supports a simple flow, while one that only offers a bulk export shifts the work toward batch import. Each login path needs its own check, so an application that uses a different flow can add more work than the number of users suggests.

Confirm these points with the legacy vendor and your own environment early: whether password hashes can be read or verified externally, what rate limits and availability the old system guarantees during the transition, and whether users will be asked to reset passwords for accounts that cannot be migrated. The answers determine the cut-over criteria and the decommissioning plan covered later on this page, and they are the inputs a fixed-scope quote needs.

What maps cleanly from the legacy store and what does not

This table compares common legacy identity capabilities with their Zitadel equivalents and flags the items that need a decision before the just-in-time flow is built. Read each row as a checkpoint: where the mapping is clear, the work is configuration, and where it is marked for decision, the design needs an owner and a confirmed answer.

Legacy capabilityZitadel equivalentMigration note
User lookup by credentialUsers within an organization, matched by login name or verified emailConfirm which identifier the legacy system accepts at login and whether the Action can query it by that identifier. Decide how duplicate emails across organizations are handled.
Password verificationPassword checked by Zitadel after the user record exists, with the legacy API called at first loginDecision: whether the legacy system can verify a password on Zitadel's behalf at login. Confirm with Zitadel's migration guide which hash algorithms and verification paths are supported.
Password hash importHash import where the algorithm is supported, otherwise a verifier at first loginConfirm exact hash algorithm support with the vendor and the migration guide. Unsupported hashes usually force a verification or reset path.
Profile attributesUser profile fields, plus custom metadata where the standard fields are not enoughMap each attribute to a standard field or metadata key. Attributes with no target need a decision on whether to keep them in the legacy store.
MFA factors (OTP, SMS)OTP and other second factors enrolled per user in ZitadelSeeds and enrolled secrets may not move with the user. Confirm with the vendor which factors can be carried over and which require re-enrollment.
PasskeysPasskeys registered through FIDO2 and WebAuthn, with password fallbackPasskey public keys are registered against a user, so they cannot be read from the legacy store at login. Decide whether users re-register after cut-over.
Groups and rolesProjects, roles and grants assigned to users within organizationsLegacy groups do not map one to one. Decide whether each group becomes a role, a grant or an organization membership, and document that choice before migration.
Application clientsApplications registered inside projects, with their own redirect URIs and token settingsClient IDs, secrets and redirect URIs change at cut-over. Plan application repointing separately from user movement.
External identity linksIdentity providers configured per organization, with linked user accountsConfirm whether existing federated links can be preserved or must be re-established at the user's next login.

Documented import paths and APIs for just-in-time migration

Zitadel gives you several documented building blocks for a gradual move: migration guides, login-time Actions, user and organization APIs, and SCIM v2 provisioning. Each card covers one piece and what to confirm before relying on it. Exact Action hooks, API calls and the legacy system's endpoints must be checked against current documentation, since they change between releases.

Migration guides as the starting point

Zitadel publishes migration guides for several source systems and names just-in-time migration as one approach. Read the guide for your source first, because it sets the assumptions the rest of the design depends on, such as whether the legacy system can answer a credential check and whether password hashes can leave it. Treat the guide as a baseline and record every place your environment differs from it, including custom user stores and non-standard hash settings.

Migration guides

Login-time Actions that call the legacy system

Zitadel Actions run custom code at defined points in the login flow. For just-in-time migration, the relevant hook is the one that runs when a user is not yet found in Zitadel, so the Action can query the legacy system and return the account. Confirm the current hook names, the available fields and the error handling behavior in the Actions documentation for your release. Plan for the Action to fail closed when the legacy system is unreachable.

User and organization APIs for first-login creation

When an Action returns a user the first time they sign in, the account must be created in the correct organization with the right identifiers and verified contact details. The Zitadel APIs cover user and organization management, and the exact calls and required fields should be read from the current API reference. Decide which organization each legacy tenant maps to before writing any creation logic, because moving an account later is harder than creating it correctly.

Zitadel API introduction

Organizations and projects as the target structure

Users live inside organizations in Zitadel, and applications and grants sit in projects. Before the first login-time creation, decide how legacy groups, roles and tenants map to these objects, since the migrated user inherits that structure on arrival. Confirm which role and grant APIs apply to your version so that migrated users receive access without manual repair afterward.

Organizations concept

SCIM v2 where the source supports it

Zitadel provides a SCIM v2 service provider interface for standardized provisioning and lifecycle management. SCIM fits when the legacy system or its identity provider can push user changes outward, so that account creation, updates and deactivations stay in sync during the transition. It does not replace login-time migration for password verification, and it only helps if the source actually supports SCIM clients. Confirm that support in the legacy system's own documentation before you design around it.

SCIM v2 guide

Legacy export and verification endpoints

A login-time Action needs a way to ask the legacy system whether a credential is valid, or to fetch a single user's record. Whether the legacy system offers such an endpoint, what it returns, and whether password hashes can be read or only verified must be confirmed in that system's documentation. If the system offers no verification endpoint, the design changes to a bulk export, which carries its own handling requirements for hashes and personal data.

How the parallel run and cutover sequence works

The sequence moves users from a legacy identity store into Zitadel gradually, so each login proves the new path works before the old one is retired. It ends with a decommissioned legacy store and a controlled archive that auditors and incident responders can still query.

  1. Inventory users, applications and password hash types

    The legacy platform owner and the application owners list every user store, every client that authenticates against it, and the hash algorithms and parameters used for stored passwords. They also record which users have MFA seeds, passkeys, or external identity links, because those factors need a deliberate path. The step closes when the inventory names each application's login flow and each hash type, and the team agrees which hash types a Zitadel verifier can accept. Confirm hash support against the current Zitadel migration documentation before committing to the design.

  2. Build the Zitadel organization and pilot group

    The team creates the target organization, projects and applications in self-hosted Zitadel, then selects a pilot group of users who can tolerate a login problem and report it. The pilot is usually one internal organization or a small set of accounts from a single application. The step closes when a pilot user can sign in through Zitadel, the Action that calls the legacy system is in place, and a rollback path for the pilot application is documented and tested.

  3. Route new logins to Zitadel with the legacy store authoritative

    Applications are repointed to Zitadel, and the legacy store stays the source of truth for every user who has not yet migrated. When a user signs in, a Zitadel Action queries the legacy system, verifies the credential, and creates or updates the local user on success. The step closes when a test run shows that an unmigrated user can sign in, that the user record appears in Zitadel afterward, and that a wrong password is rejected without creating an account.

  4. Run in parallel and monitor failed logins

    Both paths stay live while the migration runs. The operations team tracks failed logins, lookup timeouts from the legacy system, hash verification errors, and users who appear in the legacy store but never sign in. Each failure class gets an owner and a fix, such as a hash type gap or an Action timeout. The step closes when failure categories are stable and each one has a known resolution, rather than when the error count reaches zero.

  5. Apply cutover criteria per application

    The team sets written criteria before cutover, such as the share of active users already migrated, the absence of unresolved failure categories, and sign-off from the application owner. Usage data from the legacy system identifies which accounts are active, so dormant users do not hold up the decision. The step closes when the criteria are met for an application and the decision is recorded, including who approved it and the threshold used. The exact threshold is a decision for your organization, not a value this sequence supplies.

  6. Disable the legacy login path

    Once an application meets the criteria, the legacy login endpoint is switched off for that application, and the Action no longer falls back to the legacy store. Users who have not signed in yet are told how to reset access through Zitadel, and the support queue is staffed for the first days after the change. The step closes when the legacy endpoint returns a refusal for that application, a test login through Zitadel succeeds, and support tickets are tracked against the new path.

  7. Decommission the legacy store and retain an archive

    After every application has cut over and the retention period set by your records policy has been confirmed with legal and compliance owners, the legacy store is shut down. A read-only archive of its user records, authentication logs and configuration is kept under restricted access with logged reads. Access to the archive is reviewed on a schedule, and the archive owner is named. The step closes when the legacy service is stopped, the archive restore has been tested, and the access list for the archive is approved.

How a login falls through from Zitadel to the legacy store

The diagram starts at the user's sign-in request reaching Zitadel. A pre-authentication Action checks whether the user already exists in Zitadel. If not, the Action calls the legacy identity store across the trust boundary to verify the password. On success, the user is created in Zitadel and the login completes; on failure, the login returns an error and nothing is written. Check that the legacy call is authenticated, that failed attempts leave no user behind, and that the legacy system stays reachable for as long as unmigrated users remain.

Login fallback from Zitadel to the legacy store, with the trust boundary marked.

What drives the cost and duration of a just-in-time move

This table lists the factors that change the effort of a just-in-time move into Zitadel, with the cost timing for each. Read the one-time rows as build and cutover work, and the recurring rows as the running cost of keeping the legacy system live while users remain on it.

DriverWhy it changes effortOne-time or recurringHow to keep it down
Legacy verification API availabilityThe Action calls the legacy system at each login, so its API must be reachable, documented and able to answer quicklyOne-time to build, recurring while the legacy system serves loginsConfirm the endpoint, authentication method and response contract before scoping the Action
Password hash compatibilityZitadel can only verify credentials the legacy system checks for it, so unsupported hash schemes need a different pathOne-time analysis and buildAsk the legacy vendor or inventory the hash format early, and confirm it against Zitadel's supported options
Number of client applications and login flowsEach application may use a different OAuth flow, redirect pattern or token expectation, and each needs testing against the ActionOne-time per application, with testing repeated at cutoverGroup applications by login flow and migrate the simplest group first
MFA and passkey dataTOTP seeds and passkey public keys may not move through a login-time fetch, so users may need re-enrollmentOne-time design, plus support load while users re-enrollInventory which factors exist, decide per factor whether to carry data or re-enroll, and plan user messaging
Custom claims and rolesClaims and roles stored in the legacy system must be mapped to Zitadel projects, roles and grants inside the ActionOne-time mapping and testingDocument every claim each application reads and map them to a single reviewed schema
Number of tenants or organizationsEach organization may use its own identity provider, branding or policy, multiplying configuration and test casesOne-time per tenant group, with ongoing administrationGroup tenants by shared configuration and migrate pilot tenants before large ones
Monitoring and rollback requirementsLogin-time migration needs logs, alerts and a tested way to route users back to the legacy system if the Action failsOne-time setup, recurring while monitoring runsDefine failure thresholds and rollback steps in writing before the first production login
Legacy support for running alongside ZitadelIf the legacy system cannot stay online, or cannot accept calls from Zitadel, the move needs a different design or a faster cutoverRecurring for the coexistence period, and a potential redesign costConfirm with the legacy vendor or owner whether it can run during the coexistence period and for how long

What usually goes wrong during gradual migration

Gradual migration keeps two identity stores alive at once, so failures tend to come from the seam between them: accounts that never move, identities that split, and ownership that nobody holds. Each card below names one failure and the check that prevents it before cut-over planning starts.

Dormant accounts keep the legacy store alive

Users who never log in will never trigger a just-in-time import, so the legacy system stays in the path indefinitely. Before the migration starts, export a count of accounts with no login in the last 12 months and decide what happens to each group: a forced reset through a bulk import, a deactivation notice, or deletion under your retention policy. Set a dated plan for the remaining dormant accounts so decommissioning has an end date that someone owns.

Duplicate accounts from concurrent logins

If the same user signs in on two devices at once, two requests can both find no Zitadel user and both create one, leaving two identities for one person. Make the import idempotent by keying on a stable legacy identifier stored as an external user ID, and add a uniqueness check on the email address before creation. Test this with parallel login requests in a staging environment before go-live.

Legacy outages block Zitadel logins

During the transition, an Action that calls the legacy system at login makes that system a hard dependency for every user who has not yet moved. A legacy outage or slow response then stops sign-in for the whole population, not just the affected users. Define a timeout for the lookup, decide whether users who are already migrated can still sign in when the legacy system is down, and rehearse that failure path with the legacy system switched off.

Lost MFA and passkey enrollment

Users who enrolled a second factor in the legacy system may find that Zitadel asks them to set up MFA again, or that a passkey they registered elsewhere does not carry over. This generates support load and, if users skip enrollment, weakens their accounts. Confirm with the legacy vendor and your Zitadel version which second-factor material can be carried over, such as OTP seeds or passkey public keys, and list the factors that will require re-enrollment so support can plan for them.

Action errors that expose details

An Action that fails during login can return the raw error from the legacy API, including hostnames, stack traces or internal user records, to the browser. Return a generic message to the user, write the detailed error to your own logs with the request correlation ID, and confirm that the legacy credentials are never included in responses or log lines. Review the Action code with a security engineer before enabling it for any production user.

Unclear ownership of the legacy system

Gradual migration often leaves the legacy system without an owner once its application teams move on, yet it still answers login requests and holds credentials. Name one accountable owner for the legacy identity store, its patching, its access rules and its shutdown date, and record who may change the lookup endpoint. Without that owner, a certificate expiry or password policy change on the legacy side can break sign-in with no one assigned to fix it.

Questions buyers ask before choosing just-in-time migration

How much does a just-in-time migration into Zitadel cost?

The cost is driven by the written scope, not by a list price, and DeployOpen does not publish one. The main components are the work to build the login-time lookup against your legacy system, the orchestration that moves accounts over time, testing against real login paths, cutover planning, and decommissioning the old store. Each of these is paid for as labor under a fixed-scope agreement. The Zitadel pricing facts apply to Zitadel licensing and Cloud plans, not to migration work, so they do not change this estimate. Ask for a quote that separates one-time build and cutover work from any recurring support or retainer, and ask what is included in testing and post-cutover monitoring. Costs rise with the number of legacy systems, the complexity of password or token formats, and the number of applications that must be repointed.

How long does just-in-time user migration take?

Duration depends on how many login paths must be covered, how many applications authenticate against the legacy system, and how long the business allows both systems to run in parallel. A grace period is usually set by the business, so the engineering work is usually planned backward from that date. Factors that lengthen the timeline include unclear password hash formats, MFA or OTP secrets that must move, legacy systems without stable APIs, and a large number of client applications to repoint. Ask for a schedule that lists the build, test, pilot cohort, full cutover and decommissioning phases with named dependencies, and confirm which steps depend on your change approval windows.

What must our team provide for the migration to succeed?

The team needs to provide access to the legacy system, a named technical owner who can answer questions about its data model and login behavior, and a business owner who approves cutover. You will also need test accounts that cover each login type, such as password, social, MFA and any federated sign-in, plus a staging environment that mirrors production as closely as possible. Expect to supply credentials for an account that can read user records and verify passwords, and confirm how your security team will approve temporary access. Cutover approval should be written down with clear go and rollback criteria before work starts.

Can our internal team run a just-in-time migration on its own?

An internal team can do it if it has engineers who know both the legacy identity system and Zitadel's Actions and self-hosting model, enough time to test every login path, and an owner for cutover risk. The work is not large in concept, but it touches authentication, so mistakes can lock users out. Many teams handle the Zitadel side in-house and bring in outside help for the security review or for testing the failure paths. Decide early which parts of the work your team will carry, and ask any partner to state in writing which tasks they own and which they only review.

When is a bulk import a better choice than just-in-time migration?

A bulk import is usually the better choice when the legacy password hashes can be exported in a format Zitadel accepts, when the legacy system will be shut down on a fixed date, and when the user population is small enough to move in one controlled batch. It also suits cases where you do not want to keep a dependency on the old system for every login. Just-in-time migration fits better when hashes cannot be exported, when the legacy system must stay available during a grace period, or when you want to move users only as they return. Check the migration guides for the exact supported hash algorithms before choosing either path.

What happens to dormant users during a just-in-time migration?

Dormant users stay in the legacy system until they log in, which is the central feature of this approach. That means the old store must remain available for as long as those accounts are still needed, and every dormant account carries an ongoing dependency. Decide a policy before cutover: for example, whether accounts that have not logged in during the grace period are migrated in a final batch, locked, or retired after a defined review by your data owners. Ask how the plan handles accounts that were disabled or deleted in the legacy system, and confirm the retention rules with your compliance team, since the answer affects what personal data you keep and for how long.

What are the security risks of looking up users from the legacy system at login?

The lookup creates a live dependency on the legacy system during authentication, so its availability, its credentials and the network path between the two systems become part of your login security. The lookup credential must be scoped narrowly, stored in a secrets manager, and rotated. Failed or slow lookups should not allow sign-in by default, and every migrated login should be logged so you can track progress and spot abuse. Confirm with your security team how rate limits, error handling and audit records will work before the pilot begins.

Official Zitadel sources for migration and deployment

Before you plan a just-in-time migration, the most useful next read is the Zitadel migration guides, which describe the migration approaches Zitadel documents for each source system, including just-in-time migration. Read the guide for your legacy system alongside the general Zitadel migration guides overview, and note which Actions, import paths and login hooks each one assumes. Those assumptions decide whether your legacy system can answer a credential check at login, which is the core requirement of this approach. If your legacy system is not covered by a guide, treat that as a finding to resolve with the vendor and your own team rather than a gap to fill by guesswork.

Every guide should be checked against the Zitadel version you run or plan to run before any design work starts. Zitadel publishes its releases on GitHub, and the current release is listed on the zitadel/zitadel releases page. Confirm the Action API, the hosted login behavior and any user import fields in the release notes for that version, because a guide written for an older release can describe settings that have since changed. Record the version you tested against in your migration plan, and repeat the check when you upgrade.

The identity provider documentation and the SCIM v2 guide cover the parts of the design that sit outside the migration itself: how Zitadel federates login with other providers, and how user lifecycle events such as deprovisioning reach Zitadel from a directory. Read the Zitadel identity providers introduction if the legacy system will remain a login source during the grace period. Then read the Zitadel self-hosting overview to confirm the deployment model, database requirements and high availability options your just-in-time flow will depend on, since the login hook must stay reachable for as long as unmigrated users exist.

How DeployOpen scopes and delivers a Zitadel migration

The sequence turns a legacy user store into a Zitadel instance where users move over as they sign in, with a written scope, tested Actions running in your infrastructure, and a documented cut-over and decommissioning plan. Each step ends with a check you can review before the next one starts.

  1. Agree the written scope and deliverables

    DeployOpen and your team define the legacy systems in scope, the applications that sign in against them, the target Zitadel organizations and projects, and who approves each decision. The engagement is fixed-scope, so deliverables, responsibilities and the acceptance criteria are written down before any build starts. Done means a signed scope document that lists what each party provides and receives, including the infrastructure access DeployOpen needs.

  2. Inventory users, applications and password hashes

    DeployOpen works with your identity and platform owners to list every user population, login path, application client and identity attribute the legacy system holds. The team reviews which password hash algorithms are in use, which accounts carry MFA seeds or passkeys, and which records are stale or duplicated. Done means an inventory that shows which users can migrate by verifying their password at login and which need another path, such as a forced reset. Confirm with your legacy vendor which hash formats its export and verification endpoints expose.

  3. Design the lookup and verification flow

    The team designs how a Zitadel login falls back to the legacy store when a user does not yet exist in Zitadel, how the credential is checked, and how the user record is created on success. It also defines which identifiers link the two stores, how failures and timeouts are handled, and what the user sees in each case. Done means an approved sequence diagram and a list of error states, reviewed by your security team.

  4. Build and test Actions in your infrastructure

    DeployOpen builds the Zitadel Actions that call the legacy system at login, along with any service that brokers those calls, and deploys them in the environment you control. Secrets for the legacy API are stored in your secrets management setup rather than in Action code. Tests cover valid logins, wrong passwords, unknown users, legacy outages and hash upgrades. Done means a test report with each case recorded as passed or with an agreed fix.

  5. Run the parallel login period

    Applications are pointed at Zitadel for a limited group of users while the legacy store remains the source of truth. DeployOpen monitors failed lookups, latency, duplicate accounts and login errors, and the team reviews them with your operations staff. Any defect found here is fixed and retested before the wider rollout. Done means a monitoring summary showing that the defined error rate and latency thresholds, agreed in the scope, are met for the test group.

  6. Set cut-over criteria and execute the switch

    The team and your business owners set measurable cut-over criteria, such as the share of active users already migrated and the age of the last unmigrated login, based on the inventory. DeployOpen then switches the remaining applications to Zitadel and disables writes to the legacy store. Done means a cut-over record that shows each criterion, who approved it and the time of the switch, with a tested rollback procedure.

  7. Decommission the legacy store

    Once the agreed observation window passes without unmigrated logins, the legacy lookup Actions are removed, credentials are rotated or revoked, and the legacy system is archived or shut down according to your retention rules. Audit logs and the migration evidence are exported and kept where your compliance team requires. Done means a decommissioning checklist signed by your owners and a note of what remains in archive.

  8. Offer optional retainer support after go-live

    After go-live, you can choose a retainer for Zitadel upgrades, monitoring reviews, incident support and continuous security testing. Retainer scope, response expectations and fees are set in a separate written agreement, so you know what is covered before you sign. Done means a documented handover and a support agreement, or a decision to run Zitadel with your own team.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.