Restore a Supabase backup
If you’re here because something went wrong: your backups are in your own bucket or Google Drive, in plain formats, so you can restore them with or without BackupDrill in the loop. In a bucket, each snapshot sits at <prefix>/<project>/<timestamp>/ and contains dump.pgcustom, a checksummed manifest.json, a storage/ tree with your files if you added the project’s Storage S3 keys, an optional auth.dump holding your Auth users, and, from CLI 2.0 on, a RECOVERY.md runbook written for that exact snapshot: its object keys, its checksums, its extension list. So even if this website is down, the snapshot itself tells you how to recover.
First, the Supabase gotcha
Restoring the database alone does not bring back your Storage files. A database restore only recovers storage.objects, which is only the metadata. The files themselves live in a separate object store. That is why BackupDrill copies the files themselves into the snapshot under storage/ once you add the project’s Storage S3 keys: a full recovery is the database restore plus putting those files back.
If your backups are in Google Drive
Google Drive backups hold the database and may also hold the Auth users, in auth.dump. Storage files aren’t included. In your Drive, open the BackupDrill folder, then the folder named after your project. Each snapshot is a folder named by its timestamp, with dump.pgcustom, manifest.json, RECOVERY.md and, when it has Auth users, auth.dump. Restore it with the console wizard (path A), or download the snapshot folder and follow its RECOVERY.md: that is path D with the real checksum and extension list filled in. The CLI restore command (path C) reads from buckets only.
Path A: the console recovery wizard
If you have a BackupDrill account, this is the shortest route. Open the project and click Restore this project. The wizard has four steps: pick a restore point, run a read-only preflight that writes nothing to the target, review what the preflight found, then re-type the target project ref and tick the safety confirmations before anything runs. The target has to be a fresh, empty Supabase project, never the damaged one.
There are two limits. The wizard restores the database only; for Storage files it gives you the equivalent CLI command (path C below), which restores the database and files in one run when the snapshot contains them. And one-click execution needs Solo or above. On Free you can still run the read-only preflight and export the exact commands.
When the snapshot has Auth users (it has an auth.dump, and the wizard lists them among the snapshot’s facts), the wizard restores them together with the database, in one transaction: an error before the commit rolls back everything that restore wrote. If the worker can’t tell whether the commit went through, the job page says so before you retry. A box on the confirm step leaves them out. Sessions are not in any snapshot, so everyone signs in again afterwards. Auth settings, secret values and Edge Functions aren’t either; reconfigure them by hand whichever path you take.
Your target credentials are encrypted in your browser. The console and our database only ever hold ciphertext, the worker decrypts them in memory for the job, and they are deleted as soon as the job ends.
Path B: you hold the artifacts
Because backups are written to your bucket or Google Drive, recovery never depends on our service being up, or on you still being a customer. Find the snapshot you want by timestamp, then use the CLI (path C, buckets only) or plain pg_restore (path D) against it. If you’re a hosted customer and want help from a person, email support@backupdrill.com.
Path C: the CLI restore command (2.0+)
With the CLI configured for your bucket, restore recovers into a fresh Supabase project. The database goes through the same engine that scheduled drills use: it verifies the archive checksum, refuses a target that isn’t empty, pre-installs extensions, and checks the tables afterwards. Storage buckets are recreated with their recorded attributes, and every file is uploaded back and checked against the snapshot. Credentials are entered at hidden prompts, so nothing ends up in shell history; in CI you can set BACKUPDRILL_TARGET_DATABASE_URL and BACKUPDRILL_TARGET_SERVICE_ROLE_KEY as managed secrets. Start with --dry-run, then confirm by typing the target’s project ref:
TARGET_REF="abcdefghijklmnop" # the target project's ref
backupdrill restore --database \
--target-supabase-url "https://$TARGET_REF.supabase.co" --dry-run
backupdrill restore --database \
--target-supabase-url "https://$TARGET_REF.supabase.co" \
--confirm-target "$TARGET_REF"To save the files to disk instead of uploading them, skip --target-supabase-url and pass --storage-dir ./recovered.
From CLI 2.10.0, a snapshot with Auth users is restored in one transaction: the Auth users first, then your tables, so foreign keys to auth.users resolve. Links and codes for password resets and email confirmations that were pending at backup time are cleared. This needs psql from the same PostgreSQL client package as pg_restore. --skip-auth restores the database without them.
If the connection drops while the restore commits, backupdrill restore --status, run with the same target on the same machine, reports what happened to its transaction. If it committed, --finish adds the grants and foreign keys that come after the commit. Storage files are uploaded after the database, so after a dropped connection none have gone up. To upload just the files, run restore again with --target-supabase-url, without --database, and with --snapshot set to the snapshot --status names, so the files come from the same snapshot as the database.
Path D: raw pg_restore
This needs only the Postgres client tools, not the CLI. Download dump.pgcustom from the snapshot folder and restore it by hand into an empty project. The snapshot’s own RECOVERY.md has this exact command with the real object keys and the extension pre-install SQL filled in.
If the snapshot has an auth.dump, follow its RECOVERY.md instead of the command below. It turns both archives into one SQL file and runs it with psql --single-transaction, so the Auth users go in before the tables that reference them, and an error anywhere in the file rolls the whole restore back. For a snapshot without one:
read -rs PGPASSWORD && export PGPASSWORD # hidden prompt
pg_restore --no-owner --no-privileges \
--dbname "postgresql://postgres.<target-ref>@<pooler-host>:5432/postgres" dump.pgcustom
unset PGPASSWORDOne error is expected and harmless: schema "public" already exists, because the target always has it. Do not use --clean against a Supabase project: dropping and recreating public wipes Supabase’s default grants for anon/authenticated, and the restored API answers 401. As noted above, this restores the database only. If the snapshot includes Storage files, they are next to the dump under storage/.
Then set the API grants. The dump has none, and since October 30, 2026 Supabase no longer grants new tables in public to anon, authenticated and service_role. Without this step, your app’s Data API requests to the restored tables in public get permission denied. RECOVERY.md has the SQL: for a snapshot made with CLI 2.9.1 or later it is one do block that gives these roles exactly what the source had. Run it on the same connection, as the role that ran pg_restore. backupdrill restore does this step for you.
Why this page should be boring
Restore drills check, ahead of time, that a snapshot restores in a test environment. On the hosted service, every drill restores your latest snapshot into a throwaway Postgres and verifies the archive sha256, that pg_restore completes with post-data objects applied, and that table counts match with no missing or unexpectedly empty tables. If a drill fails, you get an email. When the snapshot has Auth users, the drill restores them too, and if you have triggers on the Auth tables it inserts a test user straight into auth.users, the way an email sign-up writes one, and checks that the insert gets through those triggers without an error. If you haven’t set that up yet, the quickstart takes six steps.