Migrate to Pontive
Move users, password hashes, TOTP, social sign-ins and organizations into Pontive from Auth0, Clerk, Firebase, Supabase, Cognito or NextAuth, dry run first and revertable, then switch your app to pontkit.
A migration has two halves: move the users, with the pontive migrate CLI or the import API,
then switch the app from the old provider's SDK to pontkit. Pick your provider:
Auth0
Users, bcrypt hashes from Auth0 support, social identities, organizations with roles.
Clerk
Users, password digests and TOTP from the dashboard export, organizations with roles.
Firebase
Users and Firebase scrypt hashes, verified against your project's hash parameters.
Supabase
Users, bcrypt hashes and TOTP from the auth schema; your data stays in Supabase.
Amazon Cognito
Profiles and groups. Cognito exports no hashes, so password users reset.
NextAuth.js (Auth.js)
No exporter: write the import file from the adapter's tables with one SQL query.
How a migration works
- A migration source (
msrc_…) names the system users are leaving. Each imported user keeps their id there as a legacy subject, and Firebase's hash parameters live on the source. - An import run (
uimp_…) holds one migration's options, counters and a record per row. Users are sent in batches of 100, then organizations in batches of 100 with up to 1,000 members. - Dry run by default. Every batch plans unless told to apply, and the CLI always dry-runs the whole file before it writes anything.
- Matching is by the old id, never by email. A row matches an existing user by its legacy
subject, else its
external_id. A row whose email belongs to a user it did not match fails withidentifier_conflict, so an import can never attach a password or identity to an account someone else registered. Re-sending a batch skips what it already created. - Organizations come after their users, each with its members, and a new one needs a member
with the
ownerrole. - A run can be reverted while its records exist (90 days after its last batch).
Nothing is emailed to imported users: no welcome, verification or invitation.
What your users notice
| They had | In Pontive |
|---|---|
| A password, with its hash exported | They sign in with the same password. It is re-hashed natively at that first sign-in. If it breaks your password policy they are asked to change it, unless the run allows weak passwords. |
| A password whose hash was not exported | They use Forgot password on the sign-in page the first time. |
| TOTP | Their authenticator app keeps working, when the secret was exported and the run names apps to store it under. Otherwise they enroll again. |
| Google, GitHub, Apple or a custom OIDC sign-in | Imported identities sign in directly. Without them, the first sign-in links to the account by verified email. |
| Microsoft or Entra ID sign-in | Not portable: their subject differs per app registration. They link by verified email at the first sign-in. |
| A session in the old system | They sign in once more after the cutover. |
Linking by email needs auto-link by email on in account linking (on by default), a provider that vouches for the address, and an account whose email is verified.
Before you start
- Use a development instance first. Import there, sign in as a few migrated users, then repeat against production.
- Create a secret key with the
adminrole on that instance. Migration sources and credential imports (hashes, TOTP secrets, identities) are open to the instance's owners and admins only, and never to a token acting for a user, so an AI client using the Pontive MCP server can import profiles but never credentials. - Run the CLI with
npx. It is thepontivepackage on npm, version 1.19 or later. It reads the key from the environment, never a flag, and picks the API from the key's region.
export PONTIVE_SECRET_KEY=pontive_sk_test_us_...
npx pontive@latest migrate --helpThe commands every guide uses:
| Command | Does |
|---|---|
migrate source create --name <name> --type <type> | Creates the migration source; prints its msrc_… id. |
migrate export <provider> [--out file] | Writes users, then organizations, as pontive-users/v1 NDJSON, mode 0600. |
migrate import <file> --source msrc_… | Creates a run and dry-runs every batch. Add --apply to write after the dry run and a confirmation. |
migrate run <provider> --source msrc_… | Export and import in one go, with nothing written to disk. |
migrate status [uimp_…] | A run with its options and counters, or the latest runs. |
migrate records uimp_… [--outcome failed] [--kind user|organization] | Every record of a run. |
migrate revert uimp_… [--apply] | What the run created that can be deleted; with --apply, deletes it. |
In a coding agent (CLAUDECODE, CURSOR_AGENT, CODEX_SANDBOX, GEMINI_CLI or CI set, or
--json) the CLI prints one JSON object and never prompts, so --apply also needs --yes. Read the
dry run before giving it.
Import options
A run's options are fixed when it is created, which the first dry run does. Change a flag before anything is applied and the CLI starts a new run; once a batch is applied, a different flag is refused.
| Flag | |
|---|---|
--identity-connection google=app_…:google | Import identities of that type into that app's auth connection (the connection's slug after the colon). Repeatable. Types with no mapping are left out and counted, and those users link by email. |
--totp-app app_… | Store imported TOTP secrets under that app's issuer. The app must have TOTP on. Repeatable. Without one, TOTP secrets are left out and those users enroll again. |
--role-map source_role=pontive_role,… | Organization roles. A member holding a role the map does not name is left out and reported as role_not_mapped. Without a map, roles are sent as exported. |
--on-existing skip|update | What a row matching an existing user does. update writes the profile, metadata and verified flags, and replaces credentials only while the user has not chosen a password in Pontive. Default skip. |
--allow-weak-passwords | An imported password that breaks the password policy is not forced to change at first sign-in. |
--no-events | No pontive.user.created webhook per imported user. Audit entries are written either way. |
--name <name> | The run's name. |
--delete-after | With --apply, delete the file and its state once applied. |
Roles must exist on the org type before an import names them. Every instance has owner and
admin; create others with POST /v1/authz/resource-types/org/roles
or the Pontive MCP server.
Reading the report
The dry run and the apply both end with counts for users and organizations (created, updated, skipped, failed), failures grouped by error code with each row's key, the warnings, and how many password users have no hash. The codes you are most likely to see:
| Code | Means | Fix |
|---|---|---|
identifier_conflict | Another Pontive user has this email, phone or username | Decide which account wins; the import never merges them. |
owners_required | A new organization has no member with owner | Map a source role to owner with --role-map. |
role_not_found, role_not_mapped | A role is not an org role, or the map does not name it | Create the role, or add it to the map. |
password_hash_invalid, hasher_unsupported | The hash could not be read | Fix or remove password_hash in those rows; the users then reset. |
totp_unsupported | The secret is not SHA-1, 6 digits, 30 seconds | Those users enroll again. |
In a dry run, an organization whose members are users the same import creates is reported as
pending users, not failed. import keeps .pontive-import-state.json beside the file, so an
interrupted --apply continues from the next batch when run again.
Cut over
-
Sign in on the development instance as a password user, a TOTP user and a social user.
-
Import into production with a production secret key (
pontive_sk_live_…), the same commands and a production migration source. -
Catch late sign-ups. Just before switching, export again to a new file and import it into the same run, so one revert still covers everything; rows already imported are skipped:
npx pontive@latest migrate import final.ndjson --run uimp_… --apply. -
Deploy the app on pontkit, with the production app's redirect URIs and allowed origins registered in Pontive.
-
Turn off the old system's emails and sign-ups, so nobody receives two of each.
-
Webhooks. Every imported user fires
pontive.user.createdwithcontext.source: "import"and the run's id, unless the run used--no-events. A consumer that sends welcome emails should skip those. -
Old ids in your database. By default the exporters set
external_idto the old provider's id. If your tables key users by it, put it in the access token with the app's claims template:{ "legacy_user_id": "{{ user.external_id }}" } -
Watch passwords move.
npx pontive@latest migrate source get msrc_…shows how many imported passwords still wait for their user's first sign-in.
Revert
npx pontive@latest migrate revert uimp_... # dry run: what would be deleted, what kept
npx pontive@latest migrate revert uimp_... --apply # deletes itRevert deletes, outright so the emails are free for a re-import, the users the run created that have
not signed in since, and the organizations it created that have no other members. It keeps and lists
users who signed in (signed_in), organizations with other members (has_other_members), the owner
of an organization it keeps (owns_organization), and what it may not delete (forbidden). What the
run updated is not undone. A reverted run takes no more batches.
Any other system: the file format
pontive-users/v1 is NDJSON: one JSON object per line, users before organizations. A user line is
POST /v1/users/import's user object with kind
beside its fields, an organization line POST /v1/organizations/import's organization object. The
header and summary lines are optional.
{"format":"pontive-users/v1","source_type":"other"}
{"kind":"user","legacy_subject":"42","external_id":"42","email":"jane@acme.com","email_verified":true,"name":"Jane Doe","password_hash":{"hasher":"bcrypt","value":"$2b$10$..."}}
{"kind":"organization","external_id":"acme","name":"Acme Corp","members":[{"legacy_subject":"42","roles":["owner"]}]}legacy_subject needs a migration source on the run (--source). password (plaintext) and
password_hash are exclusive; plaintext is hashed and checked against the policy at import.
hasher | value |
|---|---|
bcrypt | $2a$, $2b$, $2y$ |
argon2 | $argon2id$, $argon2i$ |
scrypt | PHC $scrypt$…, or the raw hash with salt and params |
firebase_scrypt | base64 hash with salt; the parameters on the source |
pbkdf2 | passlib's $pbkdf2…$ forms, PHC, or raw with salt and params |
django | pbkdf2_sha256$…, pbkdf2_sha1$…, argon2$…, bcrypt_sha256$…, bcrypt$… |
werkzeug | pbkdf2:sha256:…, scrypt:… |
aspnet_identity | base64 v2 and v3 |
wordpress | phpass $P$, $H$, and $wp$2y$ |
ldap | {SSHA}, {SSHA256}, {SSHA512}, {SHA} |
digest | hex or base64 MD5 or SHA digest, with salt and params.salt_position |
Hashes weaker than OWASP's current minimum (digests, LDAP, phpass, Firebase's scrypt, low-cost
bcrypt or PBKDF2) are wrapped in argon2id at import, so no weak hash is stored. HMAC with a key,
peppers and crypt(3) $1$, $5$, $6$ are refused with hasher_unsupported.
The API takes the same objects directly; see Migration sources and User imports.
Not covered yet
- Lazy migration (checking a password against the old system at first sign-in) and session carry-over are not built: users without an exported hash reset, and everyone signs in once more.
- Users without an email (phone-only) are left out: Pontive requires one.
- SMS factors and passkeys do not move; users enroll again.
- Root and resource memberships, groups and pending invitations are not imported.
- There is no migration page in the dashboard yet: use the CLI or the API.
Use Pontive with Supabase
Sign users in with Pontive and keep your data in Supabase. Supabase trusts Pontive's access tokens as a custom OIDC issuer, and Row Level Security policies scope every row to the organization in the token. Includes apps built in Lovable.
Migrate from Auth0
Move Auth0 users, bcrypt password hashes, social identities and Organizations with their members and roles into Pontive with pontive migrate, then replace the Auth0 SDK with pontkit.