Skip to content
← All guides

Production readiness

Supabase backups and point-in-time recovery: what your plan actually covers

By Jan Lipmann, appienceChecked against sources on 11 min read

Supabase takes daily backups of Pro, Team and Enterprise projects only; the Free plan has no automatic backups, so the only copy is one you made yourself. A restore replaces the whole database and takes the project offline while it runs, and backups never contain the files in Storage. If you lost one table or column, the safer route on a paid plan is to restore into a new project and copy just the missing data back.

SupabaseLovableSupabase CLIPostgreSQL

What you are seeing

Something that used to be in the database is gone, and it happened during a change, not because a user deleted it. The signals:

  • After an AI prompt like "clean up the schema" or "rename this field", a page shows empty lists, or the app shows errors such as column ... does not exist or relation ... does not exist.
  • A table in the Table Editor is empty or missing, or a column that held customer data is gone.
  • You reverted the project in Lovable to the version before the change, the code looks right again, but the data is still missing. That is expected: Lovable's docs say reverting restores the project's code only and does not roll back database data or the migrations that ran against it (Lovable version history).
  • You want to know, before anything goes wrong, whether you could get yesterday's data back at all.
Warning: If data was just lost, stop making database changes - no more AI prompts that touch tables, no more migrations - until you have decided how to restore. Every change you make now is either lost again in a restore or has to be redone by hand. Write down when the bad change ran; you need that time to pick a restore point.

How to check it yourself

Check your own project only. Everything below reads settings and data; nothing is changed. Plan limits and prices below were checked against Supabase's docs and pricing page on 2026-11-21 - they change, so confirm them on the live pages.

1. Find out which backend you are on

  • Your own Supabase project: you log in at supabase.com and see the project in the Supabase dashboard. The rest of this page is about this case.
  • Lovable Cloud (the built-in backend): there is no Supabase dashboard of yours. Lovable runs its own daily backups - its docs say it keeps "up to roughly 14 days" and you restore from More > Database > Manage > Backups (Lovable database backups). Lovable's docs also say you cannot load your own dump file into the built-in backend and that a restore always replaces the same project's database.

2. Check what your plan includes

Look at the plan of the organization that owns the project, then compare it with Supabase's numbers (as of 2026-11-21, from the Backups docs and the pricing page):

  • Free: automatic backups "Not included" on the pricing page. Supabase recommends Free projects regularly export their data with the CLI db dump command and keep off-site backups.
  • Pro: daily backups, last 7 days.
  • Team: daily backups, last 14 days.
  • Enterprise: daily backups, up to 30 days in the Backups docs (the pricing page lists Enterprise retention as "Custom").
  • Point-in-Time Recovery (PITR): a paid add-on for Pro, Team and Enterprise projects, available on all compute sizes. Retention of 7, 14 or 28 days at $0.137, $0.274 or $0.55 per hour (about $100, $200 or $400 a month). Supabase says PITR is not covered by the Spend Cap (PITR usage).

3. Look at the backups you actually have

In the dashboard open Database > Backups. Scheduled backups lists the daily backups with their times; Point in Time shows the earliest and latest recovery points if PITR is on; Restore to a New Project lists what you can copy into a fresh project (Backups). Check that the newest backup is from before the bad change - a daily backup taken after it already contains the damage.

4. Measure what a restore would touch

Run these in the SQL Editor. They tell you how long the downtime might be and what needs attention before and after a restore.

-- Size of the database. Supabase says restore downtime grows with it.
select pg_size_pretty(pg_database_size(current_database())) as database_size;
pg_database_size and pg_size_pretty are standard PostgreSQL functions (database size functions).
-- Replication slots and subscriptions must be dropped before an in-place restore
select slot_name, plugin, slot_type, active from pg_replication_slots;
select subname, subenabled from pg_subscription;
Supabase handles the slot Realtime uses automatically (Backups); anything else listed here has to be dropped before and re-created after. See pg_replication_slots and pg_subscription.
-- Extensions that call out of the database
select extname, extversion from pg_extension
where extname in ('pg_cron', 'pg_net');

-- Only if pg_cron is listed above: the scheduled jobs
select jobid, jobname, schedule, command from cron.job order by jobid;
Supabase Cron stores every job in cron.job (Supabase Cron). A restore into a new project copies these jobs and they "start running as soon as the restore completes" (Restore to a new project) - so a copy can send emails or call webhooks on its own.
-- Roles that can log in. You will also see Supabase's own roles
-- (for example postgres and authenticator); look for ones you created.
select rolname from pg_roles where rolcanlogin order by rolname;

-- Files in Storage, per bucket. These are NOT in any database backup.
select bucket_id, count(*) as files from storage.objects group by bucket_id;
Daily backups do not store passwords of custom roles, so they need new passwords after a restore. Backups hold only the metadata of Storage files, not the files, and restoring an old backup does not bring back files deleted since (Backups).

5. Try a backup of your own

On any plan, make one copy now with the Supabase CLI. Supabase's guide uses three files: roles, structure and data (Backup and restore using the CLI). The CLI runs pg_dump in a container, so Docker has to be running. Take the connection string from the Connect button in the dashboard (the Session pooler string if your network has no IPv6) and put your database password into it:

export DB_URL='postgresql://postgres.[PROJECT-REF]:[YOUR-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 \
  -x "storage.buckets_vectors" -x "storage.vector_indexes"

# Which tables made it into the data file
grep '^COPY ' data.sql
Recent CLI versions use --remote; the CLI reference says the older --db-url flag still works in v3 but is deprecated (db dump). The two excluded tables are the ones Supabase's own commands leave out, because they fail to restore.
Warning: data.sql is your users' data in plain text. Supabase notes it includes email addresses and password hashes from auth.users (Automated backups). Keep it off public repositories, shared folders and AI chats.

Why it happens

AI builders change the database by writing SQL migrations and running them against your live project. A request to rename a field, simplify the data model or "start fresh" can come out as drop table, drop column or truncate. Postgres does exactly what the SQL says, and there is no undo button for a statement that has already run - the only way back is a copy taken before it.

Which copies exist depends on the plan, and the details surprise people:

  • The Free plan has no automatic backups. Unless you exported the data yourself, there is no copy to restore.
  • Daily backups are daily. Anything written between the last backup and the mistake is not in it. Only PITR lets you restore to a moment just before the bad change - Supabase states a worst-case recovery point of two minutes (Backups).
  • A restore is all or nothing. The dashboard restores the whole database to that point; orders, sign-ups and edits made since then are replaced too. Supabase: restoring to an earlier point "replaces the current database state".
  • Backups cover the database only. Storage files, Edge Function code, Auth settings and API keys are not part of them (Restore to a new project).
  • Deleting a project deletes its backups. Supabase says it permanently removes all associated data, "including any backups stored in S3".
  • Reverting code is not restoring data, in Lovable or in Git. The migration that dropped the table already ran against the live database.

How to fix it

1. Save the current state before you restore anything

Run the three supabase db dump commands from the check section now, even though the database is damaged. Everything written since the last backup - new users, new orders - exists only in the live database, and an in-place restore wipes it. Supabase's own advice for PITR is to restore to a new project first if you want to keep your current data (Backups).

2. Pick the route that fits

  • One table, one column or a set of rows is missing, and you are on a paid plan: restore into a new project and copy the missing data back (step 3). The live app stays up and keeps today's data.
  • The whole database is broken, or the app has had no real traffic since the mistake: restore in place (step 4). Simpler, but the project is offline during the restore and everything after the restore point is lost.
  • Free plan, or no backup from before the change: you can only restore from a dump you made yourself (step 5). Supabase's docs describe no other backup for Free projects.
  • Lovable Cloud: use Lovable's own Backups page. Lovable warns a restore "cannot be undone" and that the app's code may not match the restored schema; it suggests exporting the database first (Lovable database backups).

3. Restore into a new project and copy back what is missing

  1. In the damaged project open Database > Backups > Restore to a New Project, pick the last backup before the bad change (or, with PITR, a time just before it) and click Restore (Restore to a new project). The feature needs a paid plan and physical backups; the dashboard shows the cost of the new project before you start, and it is billed like any other project until you delete it.
  2. As soon as the copy is ready, if it has pg_cron jobs, stop them in the copy's SQL Editor with the query below. Supabase says there is no way to pause them during the restore itself, so they may already have run once.
  3. Copy the missing data from the copy into the live project with psql, using the examples below for a dropped column, a dropped table or deleted rows.
  4. Check the result in the app, then delete the copy so it stops costing money and stops holding a second set of your users' data.
-- In the RESTORED COPY only, never in the live project
select cron.unschedule(jobid) from cron.job;
Removes every scheduled job from the copy so it stops calling outside services on a schedule. Database Webhooks and wrappers in the copy can still make calls, so do not write to the copy. If nothing may run at all, Supabase suggests a logical restore with the CLI (step 5) instead (Restore to a new project). Run it only if the check section showed pg_cron.

Put both connection strings in variables (Connect button in each project). \copy is a psql command that reads and writes files on your own computer (psql), so these run in a terminal, not in the SQL Editor. The table and column names are examples - use yours.

export RESTORED_DB_URL='postgresql://postgres.[COPY-REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres'
export LIVE_DB_URL='postgresql://postgres.[LIVE-REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres'

# A dropped column: export the key and the lost column from the copy
psql "$RESTORED_DB_URL" -c "\copy (select id, phone from public.profiles) to 'phone.csv' with (format csv, header)"
-- restore_column.sql
-- Run with: psql "$LIVE_DB_URL" -v ON_ERROR_STOP=1 --single-transaction -f restore_column.sql
alter table public.profiles add column if not exists phone text;

create temp table restored_phone (id uuid primary key, phone text);
\copy restored_phone from 'phone.csv' with (format csv, header)

update public.profiles as p
set phone = r.phone
from restored_phone as r
where r.id = p.id;
Use the column's original type - you can read it from the copy in the Table Editor. --single-transaction with ON_ERROR_STOP means either everything applies or nothing does.
# A dropped table: take its definition from the copy...
supabase db dump --remote="$RESTORED_DB_URL" -s public -f restored_public_schema.sql
# ...find the table's CREATE TABLE, its policies and grants in that file,
# run them in the live project, then move the rows:
psql "$RESTORED_DB_URL" -c "\copy public.orders to 'orders.csv' with (format csv, header)"
psql "$LIVE_DB_URL" -c "\copy public.orders from 'orders.csv' with (format csv, header)"
# If id is an integer identity/serial column, move its sequence past the restored rows:
psql "$LIVE_DB_URL" -c "select setval(pg_get_serial_sequence('public.orders', 'id'), (select max(id) from public.orders))"
Recreate the table from the copy's definition, not from memory, so the column order matches the CSV. Re-create its Row Level Security policies too, or the restored table is either open or unreadable. For integer ids, reset the sequence afterwards or new inserts fail with a duplicate key error (sequence functions). Tables keyed by uuid do not need this.
-- restore_rows.sql: rows deleted from a table that still exists
-- First: psql "$RESTORED_DB_URL" -c "\copy public.orders to 'orders.csv' with (format csv, header)"
-- Then:  psql "$LIVE_DB_URL" -v ON_ERROR_STOP=1 --single-transaction -f restore_rows.sql
create temp table restored_orders (like public.orders including defaults);
\copy restored_orders from 'orders.csv' with (format csv, header)

insert into public.orders
select r.*
from restored_orders as r
where not exists (
  select 1 from public.orders as o where o.id = r.id
);
Inserts only the rows that are missing, so nothing written since the backup is overwritten. If id is generated always as identity, add overriding system value after insert into public.orders. Triggers on the table fire for these inserts, as they would for new rows. If the table has generated columns, list the non-generated columns explicitly in both \copy commands and in the insert (insert into public.orders (col1, col2, ...) select col1, col2, ... from restored_orders ...).

4. Restore in place

  1. Take the dump from step 1 first.
  2. If the check section listed replication slots (other than Realtime's) or subscriptions, drop them now and re-create them afterwards, as Supabase requires (Backups).
  3. Tell your users the app will be offline. Supabase says the project is inaccessible during the restore and that downtime grows with database size; it gives no fixed duration.
  4. In Database > Backups choose the closest backup made before the bad change (or a PITR time just before it) and confirm. The dashboard shows a notification when the restore is done.
  5. Reset the passwords of any custom login roles, check the Storage files the app expects still exist, and click through the main features.
  6. If your code still expects the broken schema - for example the AI rewrote it around the dropped column - the app and the restored database no longer match. Fix the code before users hit it.

5. Restore from your own dump

Supabase's guide restores the three files into a new, empty project you create, then you point the app at it (new URL and keys) (Backup and restore using the CLI). Before you run it, enable in the new project the Database Webhooks and any extensions the old one used:

psql \
  --single-transaction \
  --variable ON_ERROR_STOP=1 \
  --file roles.sql \
  --file schema.sql \
  --command 'SET session_replication_role = replica' \
  --file data.sql \
  --dbname "$NEW_DB_URL"
This is Supabase's documented command. If you use Supabase Vault or encrypted columns, its guide has an extra step to copy the root encryption key from the old project - do it while the old project is still active, because the key cannot be retrieved once it is paused or deleted. If the app used Realtime, enable the tables again in Database > Publications of the new project; the restore does not do this.

6. Make sure it cannot cost you data again

  • Decide how much data you can afford to lose. On Pro, daily backups can lose up to a day of writes; PITR narrows that to minutes for about $100 a month at 7-day retention (as of 2026-11-21). Supabase says enabling PITR stops daily backups, because PITR replaces them.
  • Keep a copy outside Supabase as well, on every plan - deleting the project deletes Supabase's backups with it. Supabase publishes a GitHub Actions workflow that dumps roles, schema and data on a schedule, plus a step that test-loads the dump into a throwaway database so a broken backup fails loudly (Automated backups). Use a private repository only; Supabase warns that committed dumps stay in Git history and suggests a private storage bucket for anything beyond a small project.
  • Back up Storage files separately. No database backup contains them.
  • Before you accept a migration from the AI, read it for destructive statements and take a dump first:
grep -rniE "drop (table|schema)|alter table .* drop |truncate|delete from|alter column .* type" supabase/migrations/
Run from the project root of the code synced to GitHub. A match is not always wrong, but each one deserves a question to the AI: what data does this remove, and where does it go?
  • Test a restore at least once - into a new project, or with the CI restore check. A backup you have never restored is a guess.

When to get help

  • Real users kept writing to the database after the mistake, and you need to merge the restored data with today's data without losing either.
  • The migration did more than drop one thing - renamed columns, changed types, split tables - and you are not sure what the old shape was.
  • You are on the Free plan with no dump of your own and the data matters. Supabase's docs list no backup to restore from in that case.
  • The project uses pg_cron, Database Webhooks, Vault or custom roles, and a restore has to bring those back correctly.
  • You want a backup routine set up and a restore actually tested before the next AI change, not after.

Sources

Primary documentation this guide was checked against. Platforms change - if something here no longer matches, the source wins.

Frequently asked questions

Does the Supabase Free plan have backups?
Not automatic ones. As of 2026-11-21 the pricing page lists automatic backups as "Not included" on Free, and Supabase recommends exporting your data regularly with supabase db dump and keeping it off-site. If you never did, there is no Supabase backup to restore from.
I reverted my Lovable project. Why is the data still gone?
Lovable's docs say reverting restores code only. Data changes and migrations that ran after that version are not undone. Getting data back needs a database backup: Lovable's Backups page for Lovable Cloud, or Supabase's backups for your own Supabase project.
Can I restore just one table from a Supabase backup?
Not in place - the dashboard restores the whole database. On a paid plan, restore the backup into a new project, then copy the table or rows you need back into the live project with psql, and delete the copy afterwards.
Are my uploaded files included in the backup?
No. Supabase's database backups hold only the metadata of Storage files, not the files, and restoring an old backup does not bring back files deleted after it. Back up Storage separately.
Is Point-in-Time Recovery worth it?
It depends on how much data you can lose. Daily backups can miss up to a day of writes; PITR lets you restore to a moment just before the mistake, with a stated worst case of two minutes. As of 2026-11-21 it costs about $100 a month for 7 days of retention, on top of the plan, and it is not covered by the Spend Cap.
If I delete the project, are the backups kept?
No. Supabase says deleting a project permanently removes all its data, including backups, and that this cannot be undone. Keep your own copy outside Supabase before deleting anything.

Related guides

Fixed-price audit

Want someone to check the whole app, not just this?

A review of data security, production readiness and App Store readiness for apps built with AI tools. 900 USD, a ranked list of fixes within 5 business days.