Guide

Export a Supabase database: SQL, CSV or the daily backup

Four ways to get your data out of Supabase, from a full SQL dump to one table as CSV, and which one to use for a backup, a migration or a spreadsheet.

By Sascha Heyer · Last updated December 4, 2026

“Export the database” means different things depending on what happens next. Restoring into a new project needs a full SQL dump with roles and schema. A colleague who wants the orders in a spreadsheet needs a CSV. Here are the four exports Supabase supports, with the commands, as of December 2026.

1. supabase db dump: the export Supabase documents

The Supabase CLI wraps pg_dump (it runs it in Docker, so Docker must be running) and splits the result into three files. This is the form Supabase’s own guide for moving between projects restores from:

export DB_URL='postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:5432/postgres'

supabase db dump --remote="$DB_URL" -f roles.sql --role-only
supabase db dump --remote="$DB_URL" -f schema.sql
supabase db dump --remote="$DB_URL" -f data.sql --use-copy --data-only

CLI v3 calls the flag --remote; older versions use --db-url, which still works. With a linked project, --linked fills in the connection for you. The schema dump leaves out the schemas Supabase manages, because a new project creates them itself.

2. pg_dump: one file, every flag

Without Docker, plain pg_dump makes a single compressed file that restores anywhere. Use the Session pooler string from the dashboard’s Connect button, and a pg_dump of your server’s major version or newer:

pg_dump "$DB_URL" --no-owner --no-privileges \
  --exclude-schema=extensions --exclude-schema=graphql --exclude-schema=graphql_public \
  --exclude-schema=realtime --exclude-schema=_realtime --exclude-schema=supabase_functions \
  --exclude-schema=vault --exclude-schema=pgsodium --exclude-schema=pgsodium_masks \
  --exclude-schema=net --exclude-schema=cron --exclude-schema=_analytics \
  | gzip > supabase-$(date +%F).sql.gz

Need only the structure, for a code review or a fresh environment? Add --schema-only. Only one schema? --schema=public. If pg_dump stops with a row level security error, connect with a read-only role that bypasses RLS:

create role liferaft_backup with login password 'a-long-random-password' bypassrls;
grant pg_read_all_data to liferaft_backup;

Connect as liferaft_backup.<project-ref> through the pooler. The pg_dump guide covers the other errors (version mismatch, IPv6, permission denied on Supabase schemas).

3. CSV, one table at a time

For spreadsheets and analysts, psql’s \copy writes a CSV on your machine (unlike COPY … TO, which would write on the server):

psql "$DB_URL" -c "\copy public.orders to 'orders.csv' with (format csv, header)"

# a query instead of a whole table
psql "$DB_URL" -c "\copy (select id, email, created_at from public.customers where created_at > now() - interval '30 days') to 'new-customers.csv' with (format csv, header)"

The Table Editor in the dashboard can export a table’s rows as CSV too, which is fine for a quick look. CSV is not a backup: it loses types, constraints, indexes, policies and functions, and there is no consistent snapshot across tables.

4. Download the daily backup (paid plans)

On Pro and Team, Database › Backups lists Supabase’s daily backups. Supabase’s troubleshooting docs note that the downloadable logical backup file is not generated once point-in-time recovery is on; in that case use one of the exports above. The free plan has no daily backups, so there is nothing to download; Supabase’s own docs recommend exporting regularly with supabase db dump.

Which export for which job

JobUse
Move to a new projectsupabase db dump (three files), see the migration guide
Nightly backuppg_dump to one .sql.gz, scheduled, stored off-site
Spreadsheet or analysis\copy to CSV
Users onlythe auth schema, see exporting auth users
Uploaded filesS3 sync, see Storage backup

An export is only a backup once it restores

Whatever you export, restore it once into a scratch Postgres and compare row counts (the backup testing guide shows how). Liferaft does the pg_dump export every night through a read-only role, keeps the copies outside Supabase, and lets you download any of them as a plain .sql.gz; the free liferaft CLI makes the same export on your own machine.

Rather not run this yourself? Liferaft runs the dump every night through a read-only role, stores the copy outside Supabase, and restores it every week to count every row. Free for one Supabase project; Solo is $9 a month for five. Back up my Supabase project free

Frequently asked questions

Can I download a backup from the Supabase dashboard?

On paid plans, Database › Backups lists the daily backups. Supabase’s troubleshooting docs note that the downloadable logical backup file is no longer generated once point-in-time recovery is on; then use supabase db dump or pg_dump instead. The free plan has no daily backups to download.

What is the difference between supabase db dump and pg_dump?

supabase db dump runs pg_dump for you (inside Docker) with Supabase-friendly defaults: it skips the schemas Supabase manages and can split roles, schema and data into separate files. Plain pg_dump gives you one file and every flag, and needs no Docker.

How do I export one table as CSV?

Use psql’s \copy, which writes the file on your machine: \copy public.orders to 'orders.csv' with (format csv, header). The Table Editor can also export the rows of a table as CSV.

More guides

Compare Supabase backup tools