Supabase
How to Migrate from Firebase to Supabase (Step-by-Step Guide)
Jul 28, 2025
Thinking about moving from Firebase to Supabase? You’re not alone. More and more developers are making the switch to save money, get SQL, and avoid vendor lock-in.
The good news? Migrating isn’t as scary as it sounds — if you follow the right steps. Here’s a practical guide to moving your project from Firebase to Supabase without breaking everything.
💡 Why Migrate to Supabase?
Firebase is great, but Supabase offers some clear advantages:
SQL + Postgres – Say goodbye to Firestore’s NoSQL quirks.
Cheaper at scale – Self-host or use Pro plans starting at $25/month.
Open-source – No vendor lock-in, you can self-host whenever you want.
Real-time + Auth – Works out of the box, just like Firebase.
“I switched my side project to Supabase because Firestore queries were killing me. Postgres feels like cheating after years of NoSQL workarounds.”
— user @arcticdev on Twitter
🛠 Migration Overview
Here’s the big picture:
Export your data from Firebase
Set up your Supabase project
Import your data into Postgres
Replace Auth and Storage
Update your client-side code
We’ll break these down step by step.
✅ 1. Export Your Firebase Data
The easiest way to export is via the Firebase Admin SDK or the Firestore export tool.
For Firestore:
For Realtime Database:
This gives you a full JSON or Firestore export to work with.
✅ 2. Set Up a Supabase Project
Sign in at Supabase.com and create a new project.
Choose your database region close to your users.
Copy your
anon
andservice_role
keys — you’ll need them later.
(If you’re self-hosting, you can follow our self-hosting guide to run it on a VPS.)
✅ 3. Import Your Data into Supabase (Postgres)
Since Supabase uses Postgres, you’ll need to convert your JSON/Firestore export into SQL or CSV.
A simple way:
Use a tool like FireSQL or node-firestore-import-export to convert JSON to CSV.
Then use
psql
or Supabase Studio to import:
Make sure to normalize your schema (you’re going from NoSQL to SQL, so design proper tables and relationships).
✅ 4. Migrate Auth and Storage
Auth:
Export your users from Firebase with:
Then use Supabase Admin API to import (or manually add users if it’s a new app).
Storage:
Download files from Firebase Storage and upload them to Supabase Storage.
A simple Node.js script or even
gsutil cp
works for bulk transfers.
✅ 5. Update Your Client Code
This is where most of the work happens:
Replace Firebase SDK with Supabase JS.
Update all your queries to SQL-based equivalents.
Swap Firebase Auth calls for Supabase Auth (
supabase.auth.signInWithPassword
, etc.).
📊 Firebase vs Supabase Feature Comparison
Feature | Firebase | Supabase |
---|---|---|
Database | Firestore (NoSQL) | PostgreSQL (SQL + relations) |
Auth | Built-in, phone & social login | Built-in, email/social, magic links |
Storage | Google Cloud Storage | S3-compatible object storage |
Real-time | Yes (Firestore updates) | Yes (Postgres Realtime engine) |
Functions | Cloud Functions | Edge Functions (Deno) |
Self-hosting | ❌ No | ✅ Yes (Docker, Coolify, etc.) |
Pricing | Pay-as-you-go (can spike) | $25/mo Pro, or self-host cheap |
🧪 Final Tips for a Smooth Migration
Start small: Migrate one feature or module first.
Keep Firebase running temporarily: Run both backends in parallel during testing.
Use Row Level Security (RLS): Supabase’s RLS is powerful but needs careful setup.
Test thoroughly: Especially Auth and Realtime before fully switching.
🎯 Final Thoughts
Migrating from Firebase to Supabase takes some work, but the benefits are worth it: SQL, lower costs, and full control.
If you’re running a big app, take it step by step. But for small-to-medium projects, you can realistically switch in a weekend.
And once you do? You’ll probably wonder why you didn’t leave Firebase sooner.
Supadex helps you stay in control of your Supabase projects no matter where you are. Don’t wait—take your backend management to the next level today!