Migrating to Stytch
Migrating your authentication setup can seem daunting, but this guide will walk you through everything you need in order to run a smooth, zero-downtime migration to Stytch from any authentication setup, whether it's an in-house build or from a legacy provider lke Auth0 or Cognito.
Migration Steps
Below is a high level overview of the sequenced steps involved in migrating to Stytch. Each step has it's own detailed guide that will walk you through the key decisions and considerations based on your current authentication setup.
1Define your data model
The first step of planning your migration to Stytch is planning out how you want to connect your current data model to Stytch's core entities: Organizations and Members.
If you're unsure how your end user and tenant entities should map to Stytch's Members and Organizations, the reconciling data models guide covers the key considerations around multi-tenancy, account deduplication and more!
2Dual-write and backfill members and organizations
In order to achieve a smooth, zero-downtime migration without any issues around data reconciliation, we recommend setting up dual-writes prior to kicking off a backfill to Stytch. This allows any create, update, or delete requests during the backfill period are reflected in both your current system as well as in Stytch, ensuring that you can cut over to Stytch as the read source of truth without any customer impact or downtime.
However, if you have a relatively small user base you can always run the backfill without a dual write.
For more details setting up the dual-write, backfill and considerations depending on if you're coming from an in-house build or a legacy provider like Auth0, check out the migrating user data guide.
3Migrating other data and logic
Depending on your current system and offerings you might need to migrate other data to Stytch, such as:
- Single Sign-On (SSO) Connections
Roles and permissions
Ingesting events
Password poicies
Review additional migration considerations to see if any of these apply to your migration.
4Cutting over to Stytch
If you're migrating to Stytch from Auth0 (or other 3rd party providers that use OIDC JWTs) we offer a Zero-Downtime Session Migration feature that allows you to mint Stytch Sessions from an external session -- ensuring that your users can stay logged in as your cutover to Stytch.
We discuss the details of how this works, and alternative deployment strategies if you're moving from in-house or a non-OIDC compliant authentication provider in the zero down-time deployment guide.
5You're done!
You've switched to Stytch! Time to cut a satisfying PR to delete the deprecated code!