Migration

Plan identity, business data, files, subscriptions, and rollout when changing deployment modes.

Changing modes for an existing product is a migration project. The safe order is inventory → identity mapping → data copy → file copy → entitlement reconciliation → staged client rollout.

Migration checklist

  1. Freeze the source schema and export users, provider identities, business rows, files, and subscription evidence.
  2. Define a durable mapping from source user IDs to Better Auth user IDs. Never assume IDs keep their format.
  3. Recreate profiles and business data with ownership mapped to the destination session identity.
  4. Copy files, preserve MIME and ownership metadata, and rewrite persisted URLs only after verification.
  5. Reconcile one authoritative subscription snapshot per destination user before opening purchase buttons.
  6. Configure trusted origins, OAuth audiences, webhook secrets, storage, and push providers on the host.
  7. Ship a staging build with explicit Unified configuration and no fallback; run the shared smoke test.
  8. Roll out with observability and a rollback window. Revoke old sessions only after the new path is confirmed.

Never point an existing client at the new base URL before identity and entitlement mappings are complete. A successful network request can still attach data to the wrong account.

The reverse migration follows the same principles: create independent identities and stores, copy data, then change the deployed client preset.

On this page