Recovering from DROP DATABASE in Supabase
Whether you typed it yourself or your AI agent did, here's exactly what to do after a DROP DATABASE hit your Supabase — best options first, honest about the rest.
First, in the next 60 seconds
- 1. Stop all writes. Quit the app, pause the agent, and don't run another query — every write reduces what you can recover.
- 2. Don't restart, vacuum, or checkpoint the database. Those steps can permanently overwrite recoverable data.
- 3. Make a copy of the current state now (a dump, a snapshot, or the raw file) before you attempt anything.
What just happened
A DROP DATABASE removes every table, view and row at once. Recovery means restoring an entire backup or point-in-time copy — there is nothing left in the live database to salvage from.
Your recovery options in Supabase, best first
- 1
Use Point-in-Time Recovery (Pro plan)
If PITR is enabled (Project → Database → Backups), restore your project to a timestamp just before the destructive query. This is the best option and loses only the last couple of minutes.
- 2
Restore a daily backup
On paid plans Supabase keeps daily physical backups under Database → Backups. Restoring replaces the whole database, so first export anything you have changed since the backup, then restore.
- 3
Restore your own pg_dump
Supabase is plain Postgres — if you (or OopsDB) took a
pg_dump, restore it into a new project or branch and copy the affected table back. - 4
Contact Supabase support immediately
On the free plan there are no automated backups you can self-serve. Open a support request right away; the sooner you ask, the better your odds. Do not keep writing to the project in the meantime.
If you have no backup
On the Supabase free tier there are no automated backups, so a committed DROP/DELETE with no dump of your own is usually unrecoverable. This is exactly why a local tool that snapshots before every agent session matters on Supabase specifically.
Make sure this never happens again
The honest truth: your coding agent will eventually run DROP DATABASE again. The fix isn't to trust it more — it's to keep an automatic, recent snapshot so a bad query is a 30-second rollback instead of a lost weekend.
OopsDB takes an encrypted snapshot of your Supabase every few minutes and restores it with one command. It's free, open-source, and runs entirely on your machine — set it up in two minutes and the next DROP DATABASE won't cost you anything.
Free & open-source for local backups · optional €8/mo cloud vault keeps a copy off your machine · cancel anytime.