Zero-Downtime Auth Migrations
Migrating authentication on a live app is one of the riskiest operations you can run. Users are logged in, sessions are in flight, and one mistake can lock everyone out.
We chose a phased approach. Phase one: run both systems in parallel. New sign-ups and logins went through Better Auth while we backfilled and validated existing users and sessions in the new schema. We used idempotent scripts and checksums to ensure no user was duplicated or dropped.
Phase two: a short maintenance window (announced in advance) to flip the default provider and run a final sync. We kept read-only fallback to the old session store for 48 hours so any stragglers could still complete in-flight flows. After that we retired the old paths.
Result: zero downtime, zero data loss, and a cleaner auth model (Better Auth's built-in multi-tenant and token handling fit our stack better). If you're planning a similar move, run both systems in parallel for as long as you can and validate every edge case before the cutover.