Migrate from FirebaseSupabase
Postgres > NoSQL for most apps, you want SQL queries + RLS, you want to escape Google's lock-in, you want a self-hosted option, you want lower costs at scale.
Step-by-step
- 1
1. Export Firestore data
Use `gcloud firestore export` to a Google Cloud Storage bucket. Download as JSON.
- 2
2. Design your Postgres schema
Map Firestore collections → Postgres tables. Denormalize where Firestore relied on subcollections. Use Supabase's table editor or write SQL migrations.
- 3
3. Bulk-import data
Convert JSON to CSV and use Supabase's import tool, or write a Node script using the Supabase JS client.
- 4
4. Migrate auth users
Export Firebase Auth users via Firebase Admin SDK. Import into Supabase Auth using `auth.admin.createUser()` — preserve user IDs by reading from your migration map.
- 5
5. Set up Row-Level Security policies
Replace Firestore security rules with Supabase RLS policies. Common pattern: `auth.uid() = user_id` on every public table.
- 6
6. Replace Firebase SDK calls
Swap `firebase/firestore` for `@supabase/supabase-js`. Most CRUD operations map 1:1.
- 7
7. Replace Firebase Functions
Move to Supabase Edge Functions (Deno) or Database Functions (PL/pgSQL) depending on the use case.
Gotchas to watch
- Firestore's offline support is unique — Supabase has no equivalent. Use a local cache layer (Dexie, Zustand persist) if you relied on this.
- Firestore charges per document read; Postgres charges by query complexity. Heavy real-time apps may see different cost profiles.
- Firebase Auth's phone auth requires reCAPTCHA setup on Supabase too.
- If you used Cloud Storage, migrate to Supabase Storage with the bulk upload script.
More open-source picks
Lifetime gets you the full curated directory with 100+ open-source tools and deep curator takes. ₹99 once.
See pricing