Skip to content

TB-002Bulletin

Migrating users without a password reset day

Password hashes are portable, and so are TOTP secrets, passkeys and sessions. The order of operations that moved 186,000 users without one reset email.

Mateus RochaEngineer, migrations, Lisbon

Title
Technical bulletin
Doc. no.
LM-09 / TB-002
Subject
Operations
Issued
01 Sep 2026
Reading
4 min

The cheapest way to change auth systems is to email everyone a reset link. It is also the most expensive. In the migrations we have watched, a forced reset loses between 5% and 15% of monthly active users in the first month: people who meant to come back, met a chore, and did not. Almost every migration can avoid it. The password hashes you already have are portable, and so are most of the other credentials.

1.0Hashes move; passwords never do

You do not know your users' passwords, and you do not need to. A password hash is a recipe: algorithm, parameters, salt, output. Any system that can run the same recipe can verify the same password. So the import takes each hash as it is, tagged with how it was made. On the user's next successful sign-in, when the plain password passes through memory for a moment, we verify it the old way and store a new argon2id hash. The old one is deleted. Nobody is asked to do anything.

What to export for each format.
FormatExportVerified as-isThen
bcryptThe hash stringYesRehash on sign-in
argon2idThe encoded hashYesKept if parameters are current
scrypt (Firebase)Hash, salt, signer key, rounds, memory costYesRehash on sign-in
PBKDF2Hash, salt, iterations, digestYesRehash on sign-in
Salted SHA-1 / SHA-256Hash, salt, how they were joinedYesWrapped at import
Unsalted MD5HashYesWrapped at import

The last two rows deserve a note. A fast hash is dangerous to keep even for a week, so we wrap it at import: the stored value becomes argon2id(old_hash). Verification computes the old hash from the typed password, then the wrapper. The database is immediately as strong as argon2id makes it, without waiting for people to return.

users.ndjson (one line, formatted)
{  "external_id": "usr_18842",  "email": "ines@palletline.io",  "email_verified": true,  "password_hash": "$2b$12$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy",  "totp_secret": "JBSWY3DPEHPK3PXP",  "created_at": "2022-03-14T09:21:07Z"}
npx latch import users.ndjson --dry-run   # validates, writes nothingnpx latch import users.ndjson             # about 12,000 users a minute

2.0When the hashes cannot be exported

Some hosted providers will not hand over hashes, or will only do so through a support ticket that takes weeks. Then you migrate lazily: users are imported without a password, and the first time each one signs in, Latch asks the old system whether the password is right.

Browser
Latch
Old system
email + password
no hash on file
verify(email, password)
200 OK
argon2id, store
session
Fig. 2.1Lazy migration of one user. It happens once per person; step 3 never runs again for them.

Sign-in The same form as always. The user cannot tell a migration is in progress.

Lookup The user exists, imported by email and external ID, with no credential yet.

Bridge A webhook you host, or the old provider's own sign-in endpoint.

Answer A wrong password is a normal failed sign-in and is rate limited as one.

Capture The password is hashed and stored. The old system is not asked about this user again.

Result A normal session. Typical sign-in is about 300 ms slower, once.

Lazy migration has a long tail. After 30 days, expect 70% to 85% of monthly actives to have come through; the rest are people who sign in rarely. Decide in advance what happens to them when the old system is switched off: a reset email at that point reaches only users who were not going to notice anyway.

3.0Everything that is not a password

  • User IDs. Keep yours. Each imported user carries an external_id, and the SDK can return it as the subject, so no foreign key in your database changes.
  • Social accounts. Match on the provider's stable subject identifier, not on email. Keep the same OAuth client, because some providers (Apple, Facebook) issue identifiers that are scoped to the client or team; a new client makes every user look new.
  • TOTP. The shared secret is a base32 string and imports as-is. Codes from the user's authenticator app keep working.
  • Passkeys. A WebAuthn credential is bound to the rpId, a domain, not to the vendor. Keep the domain, import the credential IDs and public keys, and existing passkeys keep working.
  • Sessions. Do not sign everyone out. For 30 days, accept the old session cookie and exchange it for a new session on first contact.

4.0The order of operations

  1. Export and dry-run

    The dry run reports duplicate emails, malformed records and hash formats it does not recognise. Fix the export, not the data.

  2. Import while the old system still runs

    Imports are idempotent on external_id. Run it again the night before to pick up new sign-ups.

  3. Mirror new accounts

    Until the switch, a webhook from the old system creates each new user in Latch within seconds.

  4. Switch sign-in

    Deploy the new sign-in page. Old sessions are bridged; nobody sees a login screen who did not expect one.

  5. Watch for a week, then retire

    Compare daily sign-in success with the week before. Close the bridge after 30 days.

Caution
Do not rotate or delete the old system's signing keys before the bridge window closes. Every session being exchanged is verified against them; rotate early and you have built the forced sign-out you were avoiding.

5.0What it looks like in numbers

Palletline moved 186,000 monthly active users from an in-house Passport setup in nine days. The import itself took sixteen minutes. Most of the nine days went on the dry run, which found 412 duplicate emails differing only by case, and on waiting a full week with both systems live before anyone was willing to delete code.

186,000

Users imported

0

Reset emails sent

+0.3 pt

Sign-in success, week after vs before

Fig. 5.1 — Palletline migration, March 2026.
Note
Unverified emails import as unverified. If the old system never confirmed addresses, do not mark them verified to save a step: account linking by email is only safe when the email is known to belong to the person.

6.0Get started

Read enough. Try the part.

Everything in these bulletins is switched on in the free plan: passkeys, 60-second tokens, organizations and roles, for your first 10,000 monthly active users.

npm install @latch/nextjs

Included on Free

Monthly active users
10,000
Passkeys, codes, links
Included
Social providers
3
Organizations
5 members each
Card required
No