Supabase Backup and Restore: Dumps, Gaps and a Test Plan
On this page
Back up and restore a Supabase database: where daily backups live, how to dump with the CLI, what a backup misses, and how to test a restore.
A Supabase backup comes from two places: the daily backup Supabase takes on paid plans, which restores inside the dashboard, and a dump you take with the CLI, which restores into any project. Most teams rely on the first and skip the second. Own both, and run the second one at least once.
This guide is for founders and developers running a live product on Supabase, including Lovable apps that use their own Supabase project. It covers where the backups live, the CLI commands from Supabase's own guide, what a restore leaves out and a drill you can run in an afternoon. It adds to our general guide to database backups for startups, which covers how much data you can afford to lose. This one stays on Supabase. Plan details, prices and commands come from Supabase's documentation and pricing page, read on 16 November 2026.
Key takeaways
- Pro projects keep 7 days of daily backups and Team projects keep 14. Free projects have no backup retention, and Supabase recommends regular exports with
supabase db dump. - Supabase's documentation says physical backups are not available for download, so a dump you take yourself is the only copy that leaves the platform.
- Three dump files (roles, schema and data) and one
psqlcommand restore a database into a new project. - A database backup leaves out Storage files, Edge Functions, auth settings, API keys and custom role passwords. Each needs its own copy.
- Lovable Cloud keeps its own backups outside your Supabase dashboard, so check which backend your Lovable app uses before you trust either set.
Where do Supabase backups live, and what do they cover?
They live in the dashboard under Database, then Backups, for Pro, Team and Enterprise projects. Free projects get none. Each plan keeps a different number of daily backups, and point-in-time recovery is a separate add-on.
| Plan | Daily backups | Kept for | What to add |
|---|---|---|---|
| Free | Not included | Nothing | Export with supabase db dump and keep the file off-site, as Supabase recommends |
| Pro | Yes | 7 days | Your own dump |
| Team | Yes | 14 days | Your own dump |
| Enterprise | Yes | Up to 30 days | Your own dump |
Supabase's pricing page lists Pro from $25 a month and Team from $599 a month. Our guide to Supabase pricing works through what a real app costs on each plan.
Can you download a daily backup?
On a current project, the documentation says no. Projects on Postgres 15.8.1.079 and newer use physical backups, and Supabase's backups documentation says physical backups are not available for direct download. The dashboard restore guide covers older projects that still use logical backups. If your project is newer, the daily backup is a restore point inside Supabase and the dump in the next section is the copy you can hold yourself.
What does point-in-time recovery change?
It replaces daily backups with a restore to a moment you choose. Supabase archives write-ahead log files every two minutes by default, which gives a worst-case recovery point of two minutes. The add-on costs about $100 a month for each 7 days of retention, so 14 days costs about $200 and 28 days about $400. Enabling it stops the daily backups. A point-in-time restore replaces the current database, so Supabase advises that you restore to a new project first if you want to keep the current state.
How do you back up a Supabase database with the CLI?
Run three supabase db dump commands against your project's connection string, one each for roles, schema and data. The machine that runs them needs the Supabase CLI, Docker Desktop and the Postgres client tools that include psql.
Copy the connection string from Connect in the dashboard. Reset the database password in Database Settings if you do not have it. Use the direct connection string. If your network has no IPv6 and the project has no IPv4 add-on, use the session pooler string instead. The direct string looks like this:
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres
Supabase's backup and restore guide gives these commands:
supabase db dump --remote=[CONNECTION_STRING] -f roles.sql --role-only
supabase db dump --remote=[CONNECTION_STRING] -f schema.sql
supabase db dump --remote=[CONNECTION_STRING] -f data.sql --use-copy --data-only -x "storage.buckets_vectors" -x "storage.vector_indexes"
The roles file holds cluster roles. The schema file holds your tables, functions and policies. The data file holds the rows as COPY statements. The CLI reference says a default dump leaves out the schemas Supabase manages, such as auth and storage.
These commands use the --remote flag from the current CLI reference. Version 2 of the CLI, still common on laptops, takes --db-url in its place. The reference says --db-url still works in version 3 and goes away in version 4. Run supabase --version before you paste a command from any guide.
How often should the dump run?
Daily matches the platform's own schedule. Run the three commands from a scheduled job on a small server or a CI schedule, then copy the files to storage in a different account from the one that holds your Supabase organization. A dump that lands in the same account protects you from a bad query and leaves you exposed to a suspended account. Supabase removes a project's backups when you delete the project, so the second copy carries the most value in that case.
The Management API lists the backups the platform holds:
export SUPABASE_ACCESS_TOKEN="your-access-token"
export PROJECT_REF="your-project-ref"
curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
"https://api.supabase.com/v1/projects/$PROJECT_REF/database/backups"
Call it from the same scheduled job and raise an alert when the newest backup is more than a day old.
How do you restore a Supabase backup into a new project?
Create a new project, enable the extensions and webhooks the old one used, and run one psql command that loads the three files in a single transaction. A new project leaves the original untouched, which makes it the safer default for every restore.
- Create the new project in the dashboard.
- Enable Database Webhooks if the old database used them, and enable any non-default extensions it used.
- Copy the new project's connection string and database password.
- Run the restore, with the new connection string in place of
[CONNECTION_STRING]:psql \ --single-transaction \ --variable ON_ERROR_STOP=1 \ --file roles.sql \ --file schema.sql \ --command 'SET session_replication_role = replica' \ --file data.sql \ --dbname [CONNECTION_STRING] - If the old database used replication for Realtime, enable the publications again under Database, then Publications.
The --single-transaction and ON_ERROR_STOP flags make the restore all or nothing. A failure rolls everything back and leaves no half-loaded database. Setting session_replication_role to replica switches triggers off during the load, which Supabase's guide gives as the way to stop columns being encrypted twice. Supabase offers a Restore to a new project action in the dashboard, described in its Duplicate Project documentation, and that route copies the encryption root key for you.
Which restore errors should you expect?
- Permission errors on
supabase_admin. Openschema.sqland comment out the lines that containALTER ... OWNER TO "supabase_admin". - A grant error on
cli_login_postgres. The message readspermission denied to grant role "postgres". Openroles.sqland comment out theGRANT "postgres" TO "cli_login_postgres"line. - Custom roles that cannot log in. Daily backups leave out the passwords of custom roles, so set each one by hand with
alter user "YOUR_USER" with password 'SOME_NEW_PASSWORD';. - Vault secrets and encrypted columns that cannot be read. A backup holds encrypted data without the root key, and a new project starts with its own key. Copy the old project's key across with the pgsodium endpoint in Supabase's guide before you pause or delete the old project, because the endpoint returns the key while the project is active.
What does a Supabase backup leave out?
It leaves out everything that sits outside the Postgres tables. Copy each item below on the same schedule as the dump.
| Item | What the backup holds | What you do |
|---|---|---|
| Storage files | Metadata about the objects. A restore shows the buckets and file records and leaves the files themselves missing. | Copy the buckets with the supabase-js script in Supabase's guide. |
| Edge Functions | Nothing | Run supabase functions download NAME --remote=your_project_ref, then deploy to the target. The download skips import maps and deno.json files. |
| Auth settings and API keys | Nothing | Write down every setting and rebuild it in the new project. |
| Realtime settings, extensions and read replicas | Nothing | Enable them again by hand. |
| Custom role passwords | Left out by design | Reset them after the restore. |
| Migration history | Left out of the three files | Dump the supabase_migrations schema in a second run with --schema supabase_migrations. |
If you changed the auth or storage schemas, for example by adding a trigger or a policy, the guide tells you to restore those changes on their own and shows how to capture them with supabase db diff against the old project. Our guide to securing Supabase Storage buckets covers the access rules that go with the files.
What about Lovable apps?
It depends on which backend the app uses. A Lovable Cloud app runs on a Supabase project that Lovable manages. That project does not appear in your Supabase dashboard, so the Supabase backups page does not apply to it. If your Lovable app connects to your own Supabase project, everything above applies.
For Lovable Cloud, Lovable's backup documentation says Lovable takes one backup per day and keeps about 14 days of them. A backup covers the database, so files in storage stay as they are. A restore reverts the schema as well as the data, which means your app's code can stop matching the database if the schema changed after the backup. The database is unavailable for a few minutes while the restore runs.
You can export the database too. Lovable exports databases up to 15 GB, caps the export file at 5 GB and allows one export every 24 hours. The file is a compressed PostgreSQL archive that needs pg_restore from PostgreSQL 16 or newer tools. Download it and store it away from Lovable, because removing the database deletes the export along with the rest of your storage. Our guide to a Lovable Cloud to Supabase migration walks through the restore into your own project.
How do you test a Supabase restore?
Restore your latest dump into a scratch project, compare it with production, sign in as a test user and write down how long it took. The first run takes an afternoon and turns a guessed recovery time into a measured one.
- Run the three dump commands against production and note the start and end time.
- Create a scratch Supabase project and enable the same extensions.
- Run the
psqlrestore and note how long it takes. - Compare row counts on the tables that matter most, in production and in the scratch project:
Replace both names with your own tables.select 'public.orders' as table_name, count(*) from public.orders union all select 'public.profiles', count(*) from public.profiles; - Point a staging copy of the app at the scratch project, sign in as a test user and read one record. Open an uploaded file too. It will be missing unless you copied the Storage objects, and that gap is the finding the drill exists to catch.
- Write the total minutes next to the recovery time you set, then delete the scratch project. Delete the scratch project and nothing else, because deleting a Supabase project removes its backups.
Which mistakes break a Supabase restore?
- Launching on the Free plan with no export, then assuming the platform holds a backup.
- Pasting a
--remotecommand into a version 2 CLI, and losing an hour to the flag error. - Keeping every copy in one account, so a suspended account takes the database and the backups together.
- Pausing or deleting the old project before copying the Vault root key.
- Restoring a point-in-time backup over production without restoring to a new project first.
Frequently asked questions
Does Supabase back up free projects?
No. The pricing page lists backup retention as not included on the Free plan. Supabase's documentation says daily backups cover Pro, Team and Enterprise projects and recommends that Free projects export their data with supabase db dump and keep off-site copies.
Can I restore a Supabase backup into a different project?
Yes. The three-file dump restores into any project you create with the psql command above. The dashboard offers a Restore to a new project action as well, and that route copies the encryption root key for you.
Do Supabase backups include Storage files?
No. The database holds metadata about stored objects, and a restore does not bring back objects you deleted after the backup. Copy buckets with your own script on the same schedule as the dump.
How long does a Supabase restore take?
Supabase says the project is inaccessible during a restore and that downtime grows with the size of the database. It gives no fixed figure. The drill above gives you the number for your own database.
What happens to backups when I delete a project?
Supabase removes the project's data for good, including backups stored in S3, and you cannot undo it. Keep a dump in another account before you delete anything.
Make your next backup one you can restore
Take a dump you can open, copy the files and functions the dump leaves out, store everything away from the account that runs the database, and restore it once into a scratch project. If you would rather have a senior engineer set this up and run the first restore with you, talk to us about our backend and API development work.
Topic: AI-built apps & Supabase