Back to BlogMigration

Firebase to Supabase Migration Without Password Resets

Move a live Firebase app to Supabase with no password resets: carry over hashes, copy data with repeatable scripts, check counts, switch in stages.

Vaclav Skarka14 min read
In this guide

Short answer: You can move a live app's backend (the server, database and sign-in behind it) from Firebase to Supabase without anyone resetting a password. Firebase keeps a scrambled copy of each password, called a hash; you carry the hashes over and check each member's password against them at first sign-in. Copy data and files with scripts you can safely rerun, check nothing is missing, then switch in stages, keeping Firebase intact as your way back.

Members don't care where their data lives. They notice when they can't sign in, when a comment disappears or when a profile photo breaks. They don't notice the security risks: password hashes copied where users can read them, which is what the official import script does if you run it unchanged, or tables open to anyone because a default permission was never removed. Both are easy to avoid if planned before the first export.

I moved ProFinity, a learning and community app for aesthetics clinicians, from Firebase to Supabase in spring 2026, and every member kept their password. The switch in the app took one week to build, and it went live the following month. This guide is the general method, checked against official docs as of November 2026.

Weighing this move? Tell me what your app keeps in Firebase: sign-in, data, files. I reply with what I would move first and what could stay.

Should you move from Firebase to Supabase?

Move when the things in your app point at each other (members, posts, comments, courses, purchases) and you want the database itself to keep those links and the access rules correct; PostgreSQL, the database behind Supabase, does that. Move when you want a standard database that another engineer can take over.

Stay, or move only part, when:

You can also keep single Firebase products, such as Firebase Cloud Messaging for notifications. For a side-by-side view, see my Supabase vs Firebase comparison.

From here on, the guide is for whoever does the technical work. If you are the founder, the test list, the data protection section and the checklist near the end are for you. If nobody on your team does that work, I do it: tell me what your app keeps in Firebase and I reply with what I would move first and what could stay. If another team built the app and you are not sure a move is the right fix, the Product Rescue Audit ($500CHF 400) reviews one repository and the deployed product, and ends with a written recommendation to keep, repair or rebuild.

How do users keep their passwords after moving to Supabase?

Carry over their Firebase password hashes and check each password once, at the member's first Supabase sign-in. Firebase Auth hashes the passwords it creates with a modified version of the scrypt algorithm; copy its parameters from the Firebase console under Authentication, Users, Password hash parameters. Firebase calls these values sensitive, so keep them in a secret store, never in the app.

Supabase's Firebase Auth migration guide exports users with firestoreusers2json and inserts them into auth.users with import_users. The repository README marks its first-login password check as partly work in progress, so plan to build and test this step yourself.

The first sign-in works like this:

  1. The member enters their usual email and password, and the app tries a normal Supabase sign-in.
  2. If that fails and the account is a migrated one with no Supabase password yet, your server looks up the stored Firebase hash itself, never one sent by the app, and checks the password against it with your project's hash parameters.
  3. If it matches, the server sets that password on the Supabase user with the admin updateUserById call, and the app signs in again.
  4. If it doesn't match, the member sees the usual wrong-password message.

Throttle this endpoint, counting failed attempts per account, not just per IP address, and return the same error, in about the same time, for unknown accounts and wrong passwords (OWASP Authentication Cheat Sheet). After a successful check, delete the old hash.

Two details matter:

Is the official Supabase import script safe to use as it is?

Not without one change. The migration guide's import script gives each user a new UUID and copies the whole Firebase user record, including passwordHash, passwordSalt and any custom claims, into raw_user_meta_data. That column is visible in the user's access token and the signed-in user can edit it (Supabase Row Level Security), and an access token is Base64-URL encoded JSON that anyone holding it can read. So change the script to leave the hashes out, keep the ID mapping and the hashes in a table only server code can read, and put roles in raw_app_meta_data, which users can't change.

In plain words: run unchanged, the script leaves a scrambled copy of every password where the signed-in user, and anything holding their session, can read it.

How do Firestore collections become Postgres tables?

Each collection becomes a table, and each subcollection, such as comments under a post, its own table with a foreign key to the parent. Map fields you filter or sort on become real columns; maps you only display go into one jsonb column; user ID fields become UUIDs that reference auth.users through your ID mapping.

Supabase's Firestore migration guide copies one collection into one table of text, numeric, boolean and jsonb columns, with custom hooks for splitting complex documents into related tables. Its firestore_id option keeps the document ID as the primary key, which you want for re-runs and checks.

For member data, Supabase recommends a profiles table in the public schema whose ID references auth.users with on delete cascade. Documents written by older app versions may lack fields added later, such as a profile photo or notification setting; choose a default for each before the copy, so every row loads.

How do files move from Firebase Storage to Supabase Storage?

Supabase's Storage migration guide downloads files to your machine with download.js, in batches you can resume with a page token, then uploads them to a bucket with upload.js. The script creates a missing bucket as non-public; set its permissions before anyone can download.

Supabase Storage access is controlled by RLS policies on the storage.objects table, and by default no uploads are allowed without a policy. Plan two things:

  • If file paths contain Firebase user IDs, such as users/FIREBASE_UID/avatar.jpg, and your policies check the folder name, rename those folders to the new IDs during upload.
  • If your documents store Firebase download URLs, rewrite them to Supabase paths in the same run.

Keep the Firebase bucket until you're sure, because Supabase database backups do not include Storage objects.

How do Firebase Security Rules become row-level security?

Each Firebase Security Rule becomes a PostgreSQL row-level security (RLS) policy, which decides which rows of a table each user can see or change: a check of request.auth.uid against the document path becomes a check of auth.uid() against a column.

alter table profiles enable row level security;

create policy "Members read their own profile"
on profiles for select
to authenticated
using ( (select auth.uid()) = id );

Two facts to build on:

How do you make the migration safe to repeat?

Back up, rehearse in a throwaway project, load data so a rerun changes nothing, check counts, and switch in stages with a way back.

  1. Back up first. Firestore's managed export copies your documents to a Cloud Storage bucket. It needs the Blaze plan and isn't an exact snapshot: it may include changes made while it ran.
  2. Dry-run into a throwaway Supabase project. Run the whole pipeline end to end: users, data, files and policies.
  3. Make every load an upsert. Key each table on the Firestore document ID and use INSERT ... ON CONFLICT DO UPDATE, so a second run updates rows instead of duplicating them. Run it twice; the second run should change nothing.
  4. Count and check. Compare documents with rows per collection, Firebase users with Supabase users, password users with stored hashes, and files with objects. Open a sample of records by ID, and look for orphans such as comments whose post is missing.
  5. Switch in stages. Put all data access in the app behind one layer. After a final catch-up copy, switch writes and reads in order: users and profiles first, then the content that points at them. Older app versions still talk to Firebase, so require an update or keep syncing their changes. If you force updates, ship the minimum-version check before the migration: it only works once it is already on people's phones.
  6. Keep a rollback path. Until writes move, rollback means pointing the app back at Firebase. After that, new data exists only in Supabase, so keep a reverse copy script ready and leave Firebase read-only rather than deleting it.

What should you test before you switch?

In the dry-run project, with two test members and signed out, check that:

  • A migrated member signs in with their old password and sees their own profile, posts and files.
  • A wrong password fails normally and sets nothing in Supabase.
  • The same member's second sign-in goes straight through Supabase.
  • A Google or Apple user lands on their existing account, not a new empty one.
  • Password reset works for a migrated member who hasn't signed in yet, and their old password stops working.
  • No access token or user metadata contains a password hash.
  • A member can't read or edit another member's private rows or files, and a signed-out visitor sees only public data.
  • Old images open, new uploads work, and comments still point at the right posts.
  • An older app version behaves the way you decided: forced update or continued sync.

Does moving to Supabase change your data protection paperwork?

It can, because a new provider will hold your members' personal data. Supabase publishes a Data Processing Addendum that covers the EU GDPR, the UK GDPR and Swiss data protection law (the FADP). For US health data under HIPAA, Supabase says customers must sign a business associate agreement (BAA) with Supabase. This isn't legal advice: your counsel decides what applies, including changes to your privacy notice.

Firebase to Supabase migration checklist

  • Decided what moves and what stays on Firebase
  • Firestore managed export taken
  • Hash parameters in a secret store; every password user has a hash
  • No password hash in user metadata; hashes and ID mapping in a server-only table
  • Hash check runs on the server, throttled, with one error for every failure
  • One table per collection and subcollection, Firestore ID kept
  • Every load is an upsert; a second run changes nothing
  • Counts match for users, each collection and files
  • RLS on every exposed table, unneeded grants revoked, buckets private, policies tested
  • File URLs and user ID folders rewritten
  • Minimum-version check shipped before the switch, if you force updates
  • Every test above passed
  • Supabase DPA or BAA reviewed with counsel
  • Rollback rehearsed, and Firebase kept read-only until you're confident

Common questions

What does a Firebase to Supabase migration cost?

You get a fixed price in writing before any work starts, once I know what your app keeps in Firebase. If another team built the app, I start with the Product Rescue Audit for $500; its fee is credited toward a qualifying build started within 14 days.

How long does a Firebase to Supabase migration take?

For ProFinity, the switch in the app took one week to build: every read and write, plus the scripts that moved members, posts, profiles, comments and files. It went live the following month, with every password intact. Your timeline depends on the number and nesting of your collections, the app versions in use and how much you test. A dry run into a throwaway Supabase project shows how long the copy itself takes for your data.

Do users have to reset their passwords when you move from Firebase to Supabase?

No. Carry over their Firebase password hashes and check each password against its hash at first sign-in, the approach Supabase's migration guide points to. Google or Apple users have no password to move; they sign in with the same provider.

Can I move my data to Supabase and keep Firebase Auth?

Yes. Supabase supports Firebase Auth as a third-party auth provider, so your RLS policies can use the signed-in Firebase user. Each user needs a role: 'authenticated' custom claim, and existing users get it through a one-off Admin SDK script.

Need help with this?

If you're weighing a move from Firebase to Supabase, I plan and run it with you. I moved ProFinity from Firebase to Supabase, and every member kept their password.

Tell me what your app keeps in Firebase. I reply with what I would move first and what could stay, and you get a fixed price in writing before any work starts. Talk to me before you export the first user: the password check, the ID mapping and the rollback path are easier to design before the switch than to repair after it.

Related: my Supabase backend development, the Product Rescue Audit ($500CHF 400) for an independent look at your current setup.

Sources

Weighing a move off Firebase?

Tell me what your app keeps in Firebase. I reply with what I would move first and what could stay. Built by another team? The Product Rescue Audit ($500CHF 400) gives you a written keep, repair or rebuild plan first.

Tell me about your app

Written by Vaclav Skarka, founder of HLT3 Studio in Zurich, software engineer since 2008 and former software architect at Avaloq.