---
title: "Migrating from Fauna to Supabase"
description: "With Fauna sunsetting by the end of May 2025, a two-phase migration to Supabase keeps applications online."
url: "https://swe.quest/articles/migrating-from-fauna-to-supabase-eec2a4cdabcfd906"
canonical: "https://supabase.com/blog/migrating-from-fauna-to-supabase"
source: "Supabase"
published: "2025-03-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["schema-migrations","postgres","databases","javascript"]
---

# Migrating from Fauna to Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2025-03-21, 6 min read, How-to. Original: [https://supabase.com/blog/migrating-from-fauna-to-supabase](https://supabase.com/blog/migrating-from-fauna-to-supabase)

## Summary

With Fauna sunsetting by the end of May 2025, a two-phase migration to Supabase keeps applications online. Phase one exports Fauna collections to S3 as JSON via the Fauna CLI, loads each document into a Postgres JSONB column with a supabase-js script, and rewrites FQL calls as PostgREST queries using JSON operators. Phase two normalizes the JSONB into relational tables with SQL (including LATERAL jsonb\_array\_elements for nested arrays) and switches API calls to the normalized columns. Tradeoffs include upfront schema planning, normalization scripts for nested documents, translating FQL/GraphQL to SQL, and adding indexes afterward.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- PostgreSQL JSONB ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- JavaScript ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Fauna, Supabase, PostgREST, JSONB, FQL, supabase-js

## Related posts

- [Migrating from the MongoDB Data API to Supabase](https://swe.quest/articles/migrating-from-the-mongodb-data-api-to-supabase-e9a02b6cce3743ea.md): Supabase · 2025-03-20 · Medium · 5 min read · PostgreSQL, Schema migrations, API design, Databases
  With MongoDB's Data API and HTTPS Endpoints reaching end-of-life on September 30, 2025, Supabase's auto-generated PostgREST API is offered as a near drop-in REST replacement.
- [Supabase Local Dev: migrations, branching, and observability](https://swe.quest/articles/supabase-local-dev-migrations-branching-and-observability-770def662fe57683.md): Supabase · 2023-08-08 · Easy · 6 min read · PostgreSQL, Developer tools, Schema migrations, Testing, Deployment
  Supabase's CLI gains a batch of Postgres local-development features: \`supabase inspect db\` with 19 diagnostic commands adapted from Heroku's pg-extras, \`db dump\` backups built on pg\_dump, migration squashing and diffing via migra, pgTAP testing with \`supabase test\`, plpgsql\_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships.
- [Supabase CLI v1 and Management API Beta](https://swe.quest/articles/supabase-cli-v1-and-management-api-beta-40e0f641270aa760.md): Supabase · 2022-08-15 · Medium · 4 min read · Schema migrations, Developer tools, PostgreSQL, CI/CD, API design
  Supabase CLI v1 leaves beta with commands to manage organizations, projects and Edge Functions, plus database migration tooling, CI/CD workflows and TypeScript type generation.
- [NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB](https://swe.quest/articles/nosql-postgres-add-mongodb-compatibility-to-your-supabase-projects-with-ferretdb-44595afd7e1b96f1.md): Supabase · 2024-01-31 · Medium · 4 min read · PostgreSQL, Databases, Containers
  FerretDB, an open source MongoDB-compatible proxy, can run on top of a Supabase Postgres database, storing each collection as a table in a \`ferretdb\` schema with documents as JSONB rows.
- [A Simple 3-Step Process to Migrate from Supabase Auth to Neon Auth](https://swe.quest/articles/a-simple-3-step-process-to-migrate-from-supabase-auth-to-neon-auth-4a39ae039de9e6ef.md): Neon · 2025-03-25 · Medium · 5 min read · Identity & auth, PostgreSQL, JavaScript
  Supabase Auth users can be moved to Neon Auth (built on Stack Auth) without forcing password resets by exporting bcrypt hashes in Modular Crypt Format and importing them through the Stack Auth REST API.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
