How to download a Supabase backup as a .sql file

Short version: most projects cannot download the backups Supabase takes. Newer projects use physical backups, which you can restore in place or, on paid plans, into a new project, but not download. You can make an equivalent .sql file yourself with one command. It works on every plan, including Free, and the file can be restored into another Postgres once it has a compatible version, the extensions your schema uses, and any Supabase roles or Auth objects it references. Both paths are below, along with a trap in the official CLI that leaves people with a “backup” that has no data in it.

Check the dashboard first

Dashboard → Database → Backups. What you find depends on which backup process your project is on. Older projects still on logical backups can download each daily backup from that page, and you are done. Projects on Postgres 15.8.1.079 or newer, which includes nearly every recently created project, use physical backups, which cannot be downloaded. Enabling Supabase PITR also switches the project to physical backups, and it replaces the daily backups. The official docs’ advice for both cases is to take a manual logical backup with the CLI or pg_dump. The rest of this page shows how.

Export to .sql with pg_dump

Copy the Session pooler connection string from the Connect button at the top of the dashboard and fill in your database password. Don’t use the Direct connection string: it runs over IPv6 unless the project has the paid IPv4 add-on, and fails with a network error on many home and CI networks.

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

pg_dump "$DB_URL" \
  --format=plain \
  --schema=public \
  --no-owner --no-privileges \
  --file="backup-$(date +%F).sql"

Three flags matter here:

  • --format=plain writes readable SQL: CREATE TABLE statements followed by COPY blocks with your rows. You can open it, grep it, diff it, and replay it with stock psql.
  • --schema=public captures your application schema. Supabase-managed schemas such as auth (your users) and storage (file metadata) are left out, and dumping them as a non-superuser is restricted anyway. Know what the file does not contain before you need it.
  • --no-owner --no-privileges keeps the file portable: without them the dump hard-codes Supabase-specific roles and grants, and replaying it into a local Postgres fills the output with ownership errors.

One version check before trusting the output: pg_dump --version must be at least your server’s major version (Supabase projects run PG 15 or 17, and select version(); in the SQL editor tells you which). An older client refuses to dump a newer server.

The supabase db dump trap: schema only, no rows

The official docs’ free-tier advice names supabase db dump, so plenty of people start there. It produces clean SQL, but its default output contains no data, only schema definitions. If you glance at the file, see your CREATE TABLE statements, and file it away as a backup, you have backed up an empty database. Your rows need a second run with --data-only:

supabase db dump --db-url "$DB_URL" -f schema.sql
supabase db dump --db-url "$DB_URL" --data-only -f data.sql

(The --db-url value must be percent-encoded; otherwise a password containing @ or # breaks the URL. Inside a repo linked with supabase link, pass --linked instead.) Restoring means replaying schema.sql first, then data.sql. If you keep only one command from this page, keep the pg_dump one: one file, schema and data together.

When to use .sql and when to use .dump

Plain .sql is the right call when a human will look at the file: one-off exports, moving data between environments, checking what a table looked like last Tuesday. (Moving a whole project rather than getting a file? The export guide covers schema-only and data-only exports and the clone path; the manual backup guide covers the dashboard button.) For a recurring backup, custom format (--format=custom, conventionally .dump) is the better default: it is compressed, it can restore a single table instead of everything, and ownership decisions move to restore time where they belong. The backup options guide uses custom format for that reason. You can use both: a scheduled custom-format backup, plus an occasional .sql export when you want to look at the data.

Restoring the .sql file

psql "$TARGET_DB_URL" -f backup-2026-08-09.sql

Point it at an empty database, such as a fresh Supabase project or a local Postgres. Read the output, not the exit code: psql keeps going after errors and still exits 0. If the target already has a public schema, expect one harmless line: schema "public" already exists. Errors that name your own tables are real and mean the restore is incomplete. Restoring into a Supabase project has a few extra pitfalls, covered in its own guide.

Auto download on a schedule

If you want a fresh download every week without doing it by hand, use a scheduler. The GitHub Actions guide sets up a free weekly workflow that dumps your database into a bucket you own. BackupDrill does the same on a schedule and then restore-tests the result. Until a file has been restored, you don’t know it works; here is how to run that test yourself.

FAQ

Can I download Supabase's own daily backups?

Only if your project still uses the older logical backup process. Those projects have a download option in the dashboard. Projects on Postgres 15.8.1.079 or newer, and any project with PITR enabled, use physical backups, which can be restored in place but not downloaded. For those projects, the official docs' answer is the same as this page's: take a manual logical backup with the Supabase CLI or pg_dump.

How do I export my whole Supabase database as SQL?

Run pg_dump against your project's Session Pooler connection string with --format=plain and --schema=public. That produces one .sql file containing your application schema and all its data, replayable with psql into any Postgres. Supabase-managed schemas (auth, storage) are excluded by default, and dumping them as a non-superuser is restricted anyway.

How do I export a single table as .sql?

Add --table to the same command: pg_dump with --format=plain, --table=public.orders, and an output file. You get that table's definition and rows and nothing else. That is useful for moving one table between environments or keeping a copy before a risky migration.

What are Supabase physical backups — can I enable or disable them?

Physical backups are the block-level backup process Supabase uses for projects on Postgres 15.8.1.079 or newer and for any project with PITR enabled. The older logical backups are pg_dump-style SQL. There is no toggle: newer projects use physical backups automatically, and enabling PITR switches a project over. What matters for this page: physical backups restore in place but cannot be downloaded, so if you want a copy you can keep, you have to make a logical dump yourself.

Does the .sql file include Auth users or Storage files?

No. The auth and storage schemas are Supabase-managed and excluded from a public-schema dump. Storage files could not be in a SQL file anyway: the database only holds their metadata, while the files themselves live in a separate object store and need their own backup.

Sources

  • Supabase docs — Database Backups
  • Supabase CLI reference — db dump
  • Supabase docs — Connecting to your database
  • PostgreSQL docs — pg_dump
  • PostgreSQL docs — psql

Facts and prices last verified August 9, 2026 against the sources above. Written by the team behind BackupDrill.

Want the dump in your bucket every week, restore-tested, without maintaining a cron job? Start free. The free plan covers weekly backups for one project, and scheduled restore drills start on Solo. Or keep it DIY with the open-source CLI.