Thomas Osayi

November 22, 2026 · 8 min read · Thomas Osayi

How to back up your Supabase or Firebase database (and test the restore)

Supabase backups by plan, PITR, pg_dump and supabase db dump, plus Firestore scheduled backups, PITR and exports. How to set them up and run a restore drill.

The message usually arrives late at night: a prompt ran a migration that dropped a column, or a bulk update hit every row instead of one, and the founder wants to know how to get yesterday's data back. Sometimes the answer is a few clicks. Sometimes, on a free plan with no exports, the honest answer is that the data is gone.

This post is about making sure you get the first answer. It covers what Supabase and Firebase back up for you, what they do not, how to add your own backups, and how to prove a restore works.

Does Supabase back up my database?

Only on paid plans: at the time of writing, Supabase Pro keeps daily backups for 7 days, Team for 14 and Enterprise for up to 30, and the Free plan has no automatic backups.

Supabase's docs say Pro, Team and Enterprise projects get daily backups, visible under Database, then Backups, in the dashboard. For free projects, the docs recommend exporting your data regularly with supabase db dump and keeping copies off site.

That gap matters because many AI-built apps launch on the Free plan. Lovable and Bolt make it easy to connect a free Supabase project, and nothing warns you that real customer data now has no safety net. Free projects also pause after a week of inactivity, which is another reason I move launched apps to Pro, as covered in "What does it cost to run an AI-built app per month? A real budget."

A few details from the docs that catch people:

  • Database backups do not include Storage objects, only their metadata. Restoring an old backup does not bring back files deleted after it.
  • Daily backups do not store custom role passwords, so those need resetting after a restore.
  • The project is inaccessible during a restore, and downtime grows with database size.
  • Platform daily backups can be restored but not downloaded.

What is Supabase point-in-time recovery and is it worth it?

Point-in-time recovery lets you restore a Supabase database to any second within the retention window, and it costs about $100 a month for 7 days of retention at the time of writing.

PITR is an add-on for Pro, Team and Enterprise projects. Supabase backs up the write-ahead log about every two minutes by default, so in the worst case you lose around two minutes of data. Daily backups, by comparison, can lose up to a day.

Pricing from the docs at the time of writing:

  • 7 days of retention: about $100 a month.
  • 14 days: about $200 a month.
  • 28 days: about $400 a month.

Two notes. Enabling PITR stops the daily backups, because PITR replaces them. And restoring to an earlier point replaces the current state of the database, so if you want to keep today's data as well, restore into a new project first and copy what you need.

For an early-stage app with modest data, daily backups plus your own nightly dump are usually enough. PITR earns its price when losing even a few hours of orders, bookings or payments would be a serious business problem.

How do I back up Supabase myself with pg_dump?

Run supabase db dump with the Supabase CLI, or pg_dump against your database connection string, on a schedule, and store the files somewhere outside Supabase.

Supabase is Postgres, so the standard Postgres tools work. The CLI wraps them with sensible defaults. A complete logical backup has three parts:

  • Roles: supabase db dump with the role-only option, saved to roles.sql.
  • Schema: supabase db dump with no extra options, saved to schema.sql.
  • Data: supabase db dump with the data-only option, saved to data.sql.

Each command takes your connection string through the db-url option. Find it in the dashboard under the Connect button. Use the session pooler or direct connection rather than the transaction pooler for dumps.

To automate it, the simplest approach is a scheduled GitHub Actions workflow that runs nightly, installs the Supabase CLI, runs the three dumps with the connection string stored as a repository secret, and uploads the files to private storage such as an S3 bucket or Google Cloud Storage with a lifecycle rule that deletes files after a set number of days. Keep the repository private, and never commit the dump files themselves to Git.

How do I back up Supabase Storage files?

Back up Storage separately by copying the bucket contents to another location on a schedule, because database backups only hold file metadata.

If your app stores user uploads, such as profile photos, documents or receipts, those files live in Supabase Storage, which is S3 compatible. You can copy them with any S3 compatible tool, or with a small script that lists objects through the Supabase client and downloads them.

Practical approach:

  • Run the copy in the same nightly job as your database dump.
  • Copy only new or changed files after the first run, so the job stays fast.
  • Keep the file paths identical, so the metadata in a restored database still points at the right objects.

If your files can be regenerated, like thumbnails, skip them and back up only the originals.

What backups does Firebase offer for Firestore?

Firestore offers scheduled backups with up to 14 weeks of retention, point-in-time recovery for the last 7 days, and exports to Cloud Storage, but none of them are on until you turn them on.

Scheduled backups

Each database can have one daily and one weekly backup schedule. You cannot pick the exact time of day. Retention is configurable up to 14 weeks. Backups include all data and index configuration, but not time-to-live policies. They require the Blaze plan, and you pay for backup storage plus a charge per restore based on backup size. Restores always go to a new database, never over the existing one. You can create schedules in the Google Cloud console, with the Firebase CLI (firebase firestore:backups:schedules:create) or with Terraform.

Point-in-time recovery

With PITR enabled, you can read documents as they existed at any minute in the past 7 days and write recovered data back selectively. Google's disaster recovery guide lists a recovery point objective of one minute. Restoring from PITR data costs more than restoring from a backup.

Exports

You can export a whole database to Cloud Storage, including a PITR export from a timestamp up to 7 days back, and keep it as long as you like. That covers retention beyond 14 weeks.

My default for a launched Firebase app is a daily scheduled backup with a few weeks of retention, plus PITR if the app handles orders or payments. The security rules matter as much as backups; see "Firebase best practices before launch: the security rules checklist."

What about Firebase Storage and Auth?

Firestore backups cover Firestore only, so plan separately for Cloud Storage files and know what you can recover for Authentication.

Cloud Storage files can be copied to another bucket on a schedule with standard Google Cloud tools, and bucket versioning helps against accidental overwrites. For Authentication, the Firebase CLI can export user accounts with auth:export, which is worth running periodically if you would struggle to rebuild your user list. NOM, the React Native and Firebase food discovery app I built at LMU Tech and Digital Ventures, is a good example of why: user content comes from camera uploads, so the files matter as much as the documents that point to them.

How do I run a restore drill?

Restore your latest backup into a separate project, point a copy of the app at it, and check that real screens load with real data.

A drill I run for Supabase:

  • Create a new, empty Supabase project.
  • Restore roles.sql, schema.sql and data.sql into it with psql, in that order.
  • Copy a sample of Storage files into the matching bucket.
  • Run the app locally with the new project's URL and anon key.
  • Sign in as a test user, open the main screens, and compare record counts with production.

For Firestore, restore a scheduled backup to a new database, point a test build at it, and run the same checks.

Write down how long it took and what went wrong. The first drill almost always finds something: a missing extension, an RLS policy that references a role that was not restored, or a bucket nobody knew existed. Finding that on a calm afternoon is the whole point.

Keep the notes as a short runbook in the repository, next to the backup workflow. It should say where the backups live, who has access, which commands restore them, in what order, and how long the last drill took. When something does go wrong, the person restoring may not be you, and they will be working under pressure. A one-page runbook turns a frightening evening into a checklist.

Delete the drill project afterwards, or pause it, so it does not add to your bill or leave a second copy of customer data sitting around longer than needed.

How often should I back up and test?

Back up the database at least daily, keep two to four weeks of copies, and run a restore drill before launch and then every few months.

A schedule that suits most small apps:

  • Nightly: database dump and new Storage files, copied off provider.
  • Weekly: check that last night's job actually produced files of a sensible size.
  • Before every risky change: a manual dump. That includes migrations generated by an AI tool, bulk updates and imports.
  • Quarterly: a full restore drill.

The manual dump before risky changes is the cheapest habit on this list. Lovable says reverting a version restores code only, not database data, and Bolt says restoring a version does not change your databases either. Your code has history. Your data only has history if you created it. For the code side, see "How to undo broken AI changes with git."

The bottom line

Supabase backs up your database daily on paid plans, not on Free, and never backs up Storage files inside a database backup. Firebase gives you strong options in scheduled backups and PITR, but only after you turn them on. In both cases, add your own off-provider dumps, take a manual backup before any risky AI-generated change, and run a restore drill so you know the backup works.

If you want this set up properly, a nightly backup job with off-site storage fits my Quick Fix from $60, and it is part of what I check in Finish and Launch from $600.

Questions, answered in one line

Does Supabase back up my database automatically?

On Pro, Team and Enterprise plans yes, with 7, 14 and up to 30 days of daily backups respectively, but the Free plan has no automatic backups.

How do I download a Supabase backup?

Run supabase db dump with the Supabase CLI, or pg_dump against your connection string, because the platform daily backups can be restored but not downloaded.

Does reverting in Lovable restore my database?

No, Lovable says reverting restores code only, and data changes made after that version, including data changed by migrations, remain.

Does Firebase back up Firestore for me?

Not by default; you enable scheduled backups or point-in-time recovery yourself, and scheduled backups require the Blaze plan.

Can someone set up backups and a restore drill for me?

Thomas Osayi sets up a backup job as a single fix from $60, or as part of a launch from $600.

Sources

About the author

Thomas Osayi is a full-stack developer in Los Angeles studying computer science at Loyola Marymount University. He founded and built SQWAD, a SaaS platform Shopify brands use to run creator programs, and builds custom Next.js websites, SaaS MVPs and fixes for AI-built apps for businesses and founders.

See his work · Services and prices

Related articles

Fix, finish and launch your AI-built app

Built your app with Lovable, Bolt, v0, Replit or Cursor and got stuck? I fix the bugs, connect auth and payments, clean up the code and deploy it to production.

See the service