
Samrat PatelA Supabase backup comes from two places: the daily backup Supabase takes on paid plans, which...
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.
supabase db dump.psql command restore a database into a new project.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.
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.
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.
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.
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.
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.
[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]
5. 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.
supabase_admin. Open schema.sql and comment out the lines that contain ALTER ... OWNER TO "supabase_admin".cli_login_postgres. The message reads permission denied to grant role "postgres". Open roles.sql and comment out the GRANT "postgres" TO "cli_login_postgres" line.alter user "YOUR_USER" with password 'SOME_NEW_PASSWORD';.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.
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.
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.
psql restore and note how long it takes.select 'public.orders' as table_name, count(*) from public.orders
union all
select 'public.profiles', count(*) from public.profiles;
Replace both names with your own tables.
5. 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.
6. 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.
--remote command into a version 2 CLI, and losing an hour to the flag error.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.
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.
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.
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.
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.
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.
Originally published on the AlgoSmiths blog. AlgoSmiths builds web, mobile and AI products on fixed-price contracts, and takes apps built with Lovable, Bolt or Cursor to production. See our services.