Skip to content
Home / Migrations / FirebaseSupabase

Firebase Supabase

medium

Move from Firebase Firestore + Auth to Supabase PostgreSQL + Auth. Biggest change: NoSQL → SQL mindset.

Estimated: 8-16h · 7 steps
Progress0%
Step 1: Export Firestore data

Use firebase-admin to export all collections as JSON.

npx firebase-export-import export --project YOUR_PROJECT
Step 2: Design PostgreSQL schema

Map Firestore collections to SQL tables. Denormalized → normalized. Create migrations with Supabase CLI.

supabase init && supabase db diff --schema public
Step 3: Import data

Transform JSON to SQL inserts. Use pgloader or custom script for large datasets.

Step 4: Migrate Auth

Supabase supports email/password, OAuth, magic links. Export Firebase users with firebase-admin, import via Supabase Management API.

supabase auth admin create-user --email user@example.com
Step 5: Update client code

Replace firebase SDK with @supabase/supabase-js. Firestore queries → SQL via supabase client.

npm uninstall firebase && npm install @supabase/supabase-js
Step 6: Migrate storage

Download files from Firebase Storage, upload to Supabase Storage. Update URLs in database.

Step 7: Test & verify

Run your test suite. Check auth flows, data integrity, and real-time subscriptions.

All tests pass, auth works, data matches
Get started with Supabase