Home › All prompts › Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data
Mini pack
Free
Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data
You have a Supabase database, and you want to know your backups will actually work when you need them. These 9 free prompts help you find out what your plan really includes, make your own copies on a schedule, save your uploaded files, practice a restore, and get back only the rows you lost.
Find out what backups your Supabase plan really includes, make your own copies on a schedule, save your uploaded files, and practice a restore before you ever need one.
9 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.
Any AI chat for 1.1, 1.2 and 4.2; Grok Build (formerly Cursor) or Claude Code opened in the project for 2.1, 2.2, 2.3, 3.1, 3.2 and 4.1; plus the Supabase dashboard and GitHub Actions: every prompt that writes a script explains first and waits for "go"; 1.1, 1.2 and 4.2 change nothing; 2.1, 2.3 and 3.2 are read-only against the live project; no prompt restores over the live project, and secrets are read from env vars or GitHub secrets and never printed or pasted. 1.1 maps what the reader's plan covers (daily backups, PITR, Storage files, deleted project) and the gaps; 1.2 sizes a backup plan to how much data the app could lose, with no prices quoted. 2.1 makes a three-file db dump into a dated folder outside the repo; 2.2 sets up a nightly GitHub Actions backup from Supabase's example in a private repo only, with Supabase's restore-check step; 2.3 copies every Storage file with a read-only supabase-js script and a count report. 3.1 is a restore drill into a local or spare database with Supabase's psql command; 3.2 compares row counts, spot-checks IDs, checks RLS policies and logs the result. 4.1 restores to a separate database first and copies back only the missing rows; 4.2 is a one-page "we lost data" plan.
Supabase and GitHub facts: daily backups on Pro (7 days), Team (14) and Enterprise (up to 30) under Database > Backups; Free plan told to use db dump and keep off-site copies; PITR is a paid-plan add-on that replaces daily backups; backups leave out Storage objects and custom role passwords; deleting a project deletes its backups; restores take the project offline and replace current data; Restore to a New Project is for paid plans with physical backups, copies auth users, shows costs first, and starts pg_cron/pg_net jobs straight away; the CLI dump and psql restore commands, Docker requirement, Session pooler for IPv4-only networks and GitHub runners, private-repo-only warning, and restore-check step. GitHub: schedules run in UTC unless a timezone is set, only from the default branch, and can be delayed at the start of the hour. All checked against Supabase's docs and GitHub Docs on Dec 4, 2026.
Left out: all prices (PITR, plans, new projects), the Spend Cap, the two-minute RPO figure, Management API commands, the root-key copy for Vault, the public-repo 60-day rule, other database hosts, and every X post from the topic research.
Not repeated here: the first minutes after a delete point to Don't Let the AI Delete Your Data 4.2; leaving a builder to Your AI App Builder Is Shutting Down; saves that never reach the database to Saves That Stick.
No stats or X claims: no numbers beyond Supabase's and GitHub's own documented behaviour, no X posts quoted, and no affiliate or sponsor copy.
Written for use with Supabase, Grok Build (formerly Cursor), Claude Code and GitHub Actions, plus any AI chat for planning. Not yet tested against them.
Use this when you've never looked at your Supabase backup settings, or you're not sure what your plan includes. You get a plain list of what's covered, what isn't, and what to check in your dashboard.
Fill in: [MY SUPABASE PLAN] (e.g. "Free", "Pro" or "not sure"), [IS PITR ON] (e.g. "yes", "no" or "not sure"), [WHAT MY APP STORES] (e.g. "user accounts, recipes and recipe photos"), [MY OWN COPIES] (e.g. "none" or "a dump I made last month").
Help me find out what backups my Supabase app really has. Don't guess at Supabase's rules: use only the facts below, and tell me to check Supabase's current docs for anything they don't cover.
Facts from Supabase's docs (checked December 4, 2026):
- Pro, Team and Enterprise projects get a daily backup. Pro can reach the last 7 days, Team the last 14 days, Enterprise up to 30 days. They're in the Dashboard under Database, then Backups.
- Free plan projects should export their own data regularly with the Supabase CLI's db dump command and keep copies somewhere else.
- Point-in-Time Recovery (PITR) is an add-on for Pro, Team and Enterprise projects. It restores to an exact moment. With PITR on, daily backups stop because PITR covers them.
- Database backups don't include files stored in Supabase Storage, only details about them.
- Daily backups don't keep passwords for custom database roles.
- Deleting a project permanently deletes its backups too.
- A restore makes the project unavailable while it runs, and replaces what's there now.
About my app:
My Supabase plan: [MY SUPABASE PLAN]
Is PITR on: [IS PITR ON]
What my app stores: [WHAT MY APP STORES]
My own copies: [MY OWN COPIES]
Please:
1. Make a table with three columns: "What could go wrong", "Am I covered?" (yes, no or check this) and "Why". Include: a bad delete today, a bad change I only notice next week, lost uploaded files, my project getting deleted, and losing access to my Supabase account.
2. Tell me exactly where to look in my dashboard to confirm my plan, whether PITR is on, and the date of my newest backup.
3. List the gaps, biggest first, and the prompt in this order that fixes each: my own database copy, a nightly copy, a copy of my uploaded files, or a practice restore.
4. Finish with the one thing I should do today.
Tips to customize: If you don't know your plan, look at your organization's billing page in the Supabase dashboard. If the Backups page is empty or says your plan doesn't include backups, skip straight to Prompt 2.1 and make your own copy today. Even on a paid plan, keep one copy outside Supabase: it's the only one that survives a deleted project or a locked account.
1.2 How Much Data Could I Afford to Lose?
Untested: not yet run against a model.
Use this when you know what backups you have and want to decide if they're enough for your app. You get a simple backup plan sized to your app, in plain words.
Fill in: [WHAT MY APP DOES], [HOW OFTEN DATA CHANGES] (e.g. "a few sign-ups a day" or "orders every few minutes"), [WHAT A LOST DAY WOULD COST MY USERS] (e.g. "they'd retype a few notes" or "orders and payments would go missing"), [WHAT I HAVE NOW] (paste the table from Prompt 1.1).
Help me decide how much backup my app really needs. Don't write any code, and don't quote prices. Tell me to check Supabase's pricing page for costs.
What my app does: [WHAT MY APP DOES]
How often data changes: [HOW OFTEN DATA CHANGES]
What a lost day would cost my users: [WHAT A LOST DAY WOULD COST MY USERS]
What I have now: [WHAT I HAVE NOW]
Please:
1. In plain words, tell me the most data I could lose with what I have now (for example, "up to a day of new sign-ups"), and how long my app might be down while I restore.
2. Ask me two quick questions if you need to, like "Would losing one hour of data be okay?" Then wait for my answers.
3. Recommend one of these and explain why: my own copies plus Supabase's daily backups, adding PITR, or a nightly copy outside Supabase on top of either.
4. Say how often I should make my own copy, how many old copies to keep, and where to keep them (somewhere private, not in my code folder and never in a public place).
5. Say how often I should practice a restore (Section 3 of this pack) and put it on a simple calendar.
6. Write it all as a short "My backup plan" note I can save.
Tips to customize: For a hobby app, your own copies plus a monthly practice restore may be plenty. If you take payments or orders, losing even an hour can hurt, so ask the AI to explain what PITR would change for you, then check the cost on Supabase's pricing page before you decide. Save the note somewhere you'll find it on a bad day, not only in a chat.
Section 2: Make Copies You Control
2.1 Make a Full Copy of My Database I Can Keep
Untested: not yet run against a model.
Use this when you want your own copy of your Supabase database, right now or before any risky change. You get the commands from Supabase's docs, set up so your password never lands in your code or your chat.
Fill in: [MY COMPUTER] (e.g. "Mac", "Windows" or "Linux"), [WHERE I'LL KEEP COPIES] (e.g. "an encrypted folder in my cloud drive" or "a USB drive").
Help me make a full copy of my Supabase database that I keep myself. Look first and explain before changing anything. Don't run anything that changes my database: this is read-only.
Facts from Supabase's docs (checked December 4, 2026):
- The Supabase CLI makes a copy in three files: roles, schema and data:
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"
- It needs the Supabase CLI and Docker running.
- The connection string is in the Connect panel of my project. Use the direct connection string, or the Session pooler one if my network doesn't support IPv6.
- data.sql holds my rows as plain text, including email addresses and password hashes from my users' accounts.
My computer: [MY COMPUTER]
Where I'll keep copies: [WHERE I'LL KEEP COPIES]
Please:
1. Check if I have the Supabase CLI and Docker, and tell me how to install whatever's missing. Don't install anything yourself.
2. Write a small script that reads my connection string from an environment variable or a .env file, never from the script itself, and never prints it.
3. Make the script save the three files into a new folder named with today's date and time, outside my project folder.
4. Check that .env and any backup folder are in .gitignore, so nothing with my password or data can be committed.
5. After it runs, show me the size of each file and the first few lines of schema.sql, so I can see it worked.
6. Show me the script and wait for me to say "go" before saving it.
Tips to customize: Run your script before every risky change, like a big migration or a cleanup, and keep the newest few copies. Because data.sql holds your users' emails and password hashes, keep copies somewhere private, ideally encrypted. If the commands fail with a connection error, ask the AI whether you need the Session pooler string instead of the direct one. A copy isn't proven until you've restored it once, so do Section 3 soon.
2.2 Back Up My Database Every Night With GitHub Actions
Untested: not yet run against a model.
Use this when you want a fresh copy of your database made automatically, so you never have to remember. You get a GitHub Actions workflow based on Supabase's own example, with a check that the copy really loads.
Fill in: [MY REPO IS PRIVATE] (e.g. "yes", "no" or "not sure"), [WHAT TIME TO RUN IT] (e.g. "3 AM New York time"), [WHERE THE COPIES SHOULD GO] (e.g. "a private storage bucket" or "a separate private GitHub repo just for backups").
Help me set up a nightly backup of my Supabase database with GitHub Actions. Look first and explain before changing anything.
Facts from Supabase's and GitHub's docs (checked December 4, 2026):
- Supabase's example workflow runs supabase db dump three times (roles, schema and data) using a SUPABASE_DB_URL secret stored in GitHub's secret settings.
- GitHub's runners only support IPv4, so the secret should be the Session pooler connection string from my project's Connect panel, unless I have Supabase's IPv4 add-on.
- Never back up to a public repo. data.sql includes user emails and password hashes, anyone who can read the repo can read it, and committed files stay in Git history even after deleting them. For anything beyond a small private project, Supabase suggests a private storage bucket instead of committing the files.
- Supabase's docs add a final step that loads the three files into a throwaway local database on the runner (supabase db start, then psql with --single-transaction and ON_ERROR_STOP=1), so a broken copy fails the run.
- GitHub's schedule uses cron times in UTC unless I set a timezone, only runs from the default branch, and can be delayed at busy times like the start of each hour.
My repo is private: [MY REPO IS PRIVATE]
When to run it: [WHAT TIME TO RUN IT]
Where the copies should go: [WHERE THE COPIES SHOULD GO]
Please:
1. If my repo isn't private, or I'm not sure, stop and tell me how to check before doing anything else.
2. Write the workflow file in .github/workflows/, with a schedule at a time that's not on the hour, and a manual "Run workflow" button.
3. Include Supabase's "check that the backup restores" step at the end.
4. Save the copies where I said, named with the date. Never print the secret or the data in the logs.
5. Tell me step by step how to add SUPABASE_DB_URL in my repo's Settings, under Secrets and variables, then Actions. I'll paste the value myself.
6. Tell me how to see if last night's run passed, and how GitHub tells me when a run fails.
7. Show me the file and wait for me to say "go" before saving it.
Tips to customize: Run it once by hand right after you set it up, and check that the restore step passes. Look at the Actions tab once a week at first: a backup that quietly stopped running is worse than none, because you think you're safe. If your copies go into a storage bucket, keep that bucket private and ask the AI to delete copies older than your plan from Prompt 1.2 says.
2.3 Don't Forget the Uploaded Files
Untested: not yet run against a model.
Use this when your app lets people upload files, like photos, avatars or PDFs. Supabase's database backups don't include these, so you get a read-only script that copies every file into a dated folder you keep.
Fill in: [MY STORAGE BUCKETS] (e.g. "avatars and receipts" or "not sure"), [ROUGHLY HOW MANY FILES] (e.g. "about 200" or "not sure"), [WHERE I'LL KEEP COPIES] (e.g. "an external drive").
Help me back up the files my app stores in Supabase Storage. Supabase's docs say database backups don't include these files, only details about them. Look first and explain before changing anything. The script must only read and download. It must never upload, move or delete anything.
My storage buckets: [MY STORAGE BUCKETS]
Roughly how many files: [ROUGHLY HOW MANY FILES]
Where I'll keep copies: [WHERE I'LL KEEP COPIES]
Please:
1. Find the bucket names my app uses in my code, and tell me which ones hold users' files.
2. Write a small script using the official supabase-js library that lists every file in each bucket, including files inside folders, and downloads each one into a folder named with today's date, keeping the same folder layout.
3. Supabase's own example lists files up to 1000 at a time, so make sure the script keeps going until it has every file, not just the first page.
4. Read my project URL and key from environment variables or a .env file that's in .gitignore. Never put a key in the script, and never print it. Tell me which key the script needs and why.
5. At the end, print a short report: files found and files downloaded for each bucket, and the name of any file that failed.
6. Show me the script and wait for me to say "go" before saving it.
Tips to customize: Your database copy and your file copy belong together, so make them on the same day and keep them in the same dated folder. If the report says files found and files downloaded don't match, run it again before you trust the copy. Some files may be private to each user, which is another reason to keep your copies somewhere only you can open.
Section 3: Practice the Restore
3.1 Restore Drill: Load My Copy Into a Throwaway Database
Untested: not yet run against a model.
Use this when you have a copy from Prompt 2.1 or 2.2 but have never tried loading it. You get a safe practice restore into a database you can delete, never your live project.
Fill in: [WHERE MY COPY IS] (e.g. "the backups/2026-12-04 folder on my desktop"), [WHERE TO RESTORE] (e.g. "a local database on my computer" or "a spare Supabase project I just made").
Help me practice restoring my Supabase backup into a throwaway database. This is a drill. Never connect to or change my live project. Before running anything that writes to a database, show me which database it points at and wait for me to say "go".
Facts from Supabase's docs (checked December 4, 2026):
- To restore the three files, Supabase uses:
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]
- For a local throwaway database, Supabase's backup check runs supabase init and supabase db start in a temporary folder, then restores into postgresql://postgres:postgres@127.0.0.1:54322/postgres.
- When restoring into a new Supabase project, first turn on Database Webhooks (if the old project used them) and any non-default extensions the old project used.
- Custom roles that log in need their passwords set again after a restore.
Where my copy is: [WHERE MY COPY IS]
Where to restore: [WHERE TO RESTORE]
Please:
1. Check that the restore target is a throwaway database and not my live project. Show me the host it points at, with no password, and explain how you can tell.
2. Tell me what I need installed (like psql or Docker) and how to check. Don't install anything yourself.
3. Write the restore steps as a small script, reading any connection string from an environment variable.
4. If the restore fails, show me the exact error and explain it in plain words before trying anything else. Supabase's docs list known errors and fixes; check those first.
5. When it works, tell me how long it took, so I know roughly how long a real restore might take.
6. Write a short "How I restore my database" note with the exact steps that worked, and save it next to my backups.
Tips to customize: A local database is the safest place to practice, since nothing you do there can reach your users. Time the drill: it's your best guess at how long your app would be down on a real bad day. If you used a spare Supabase project, delete it when you're done so it doesn't hang around with a copy of your users' data.
3.2 Prove the Restored Copy Is Complete
Untested: not yet run against a model.
Fill in: [MY MOST IMPORTANT TABLES] (e.g. "profiles, orders and messages"), [WHEN THE COPY WAS MADE] (e.g. "last night at 3 AM").
Help me prove my restored copy is complete. Use read-only queries only, on both databases: no inserts, updates, deletes or schema changes. Read connection strings from environment variables and never print them.
My most important tables: [MY MOST IMPORTANT TABLES]
When the copy was made: [WHEN THE COPY WAS MADE]
Please:
1. Write a script that counts the rows in every table in my public schema, plus the number of user accounts, in both my live project and the restored copy, and prints them side by side.
2. Flag any table where the copy has fewer rows. Explain whether that could just be new data added since the copy was made, or a real gap.
3. For each of my most important tables, pick 5 records made before the copy was taken and check they match in both, without printing anyone's private details. Show only IDs and whether they match.
4. Check that my Row Level Security policies came back in the copy, and list any table where they're missing.
5. If I backed up uploaded files with Prompt 2.3, compare the file counts in that report with the counts in my Storage buckets.
6. Finish with a one-line verdict: "Restore passed", or "Restore has gaps" with the list.
7. Add a dated line to a backup log file: when I ran the drill, how long the restore took, and the verdict.
Tips to customize: Small differences are normal if your app kept getting new data after the copy was made. A table that's empty in the copy is not normal. Keep the backup log next to your restore note: on a bad day, "Restore passed" with a recent date is a very calming thing to read. Repeat the drill on the schedule from Prompt 1.2, and after any big change to your tables.
Section 4: When Data Is Really Missing
4.1 Get Back Only the Rows I Lost
Untested: not yet run against a model.
Use this when some data is gone, you've already stopped whatever deleted it, and you want those rows back without rolling your whole app back in time. You get a plan that restores into a separate database first, then copies back only what's missing.
Fill in: [WHAT'S MISSING] (e.g. "all orders from Tuesday"), [ROUGHLY WHEN IT WAS LOST] (e.g. "yesterday around 2 PM"), [MY BACKUPS] (e.g. "Pro daily backups and my own copy from Monday").
Some data is missing from my live Supabase project and I want only those rows back. Don't change my live project until I say "go" for each step. Never restore over my live project.
Facts from Supabase's docs (checked December 4, 2026):
- Restoring a backup or using PITR on my project replaces everything there now, and the project is unavailable while it runs. To keep current data, restore to a new project first.
- "Restore to a New Project" is on the Database, Backups page, for paid plans with physical backups. It makes a separate copy of the database, including user accounts. It adds to my bill, and Supabase shows the cost before I start.
- In that copy, scheduled jobs and outside calls from extensions like pg_cron and pg_net start running as soon as the restore finishes. If that's a risk, a manual restore of my own copy (Prompt 3.1) avoids it.
- Supabase says the safe way to get deleted rows back is to restore from a backup made before the deletion, then copy the rows I need into my live project.
What's missing: [WHAT'S MISSING]
Roughly when it was lost: [ROUGHLY WHEN IT WAS LOST]
My backups: [MY BACKUPS]
Please:
1. Pick the newest backup made before the loss, and tell me which one and why.
2. Tell me where to restore it: a new Supabase project or a throwaway database from my own copy. Point out anything in my app (like scheduled jobs or webhooks) that could fire from the copy and reach real users.
3. Once the copy is ready, write read-only queries to find exactly which rows exist in the copy but not in my live project, and show me the count and the IDs.
4. Write the copy-back step to insert only those missing rows, skipping any that already exist, and keeping their original IDs. Check for rows in other tables that depend on them.
5. Before running it, show me exactly what it will insert and into which database, and wait for my "go".
6. Afterwards, count again to prove the rows are back, and tell me when it's safe to delete the copy.
Tips to customize: If the loss is still happening, stop it first: Don't Let the AI Delete Your Data, Prompt 4.2, covers the first few minutes. A copy that's newer is better, as long as it was made before the loss. If you have no backup from before the loss, ask the AI what else holds the data, like payment receipts or emails, and rebuild from those instead. Delete the restored copy when you're done, since it holds your users' data.
4.2 My One-Page "We Lost Data" Plan
Untested: not yet run against a model.
Fill in: [MY BACKUP PLAN] (paste the note from Prompt 1.2), [MY RESTORE NOTE] (paste the note from Prompt 3.1), [WHO ELSE SHOULD KNOW] (e.g. "just me" or "my co-founder"), [HOW I REACH MY USERS] (e.g. "email" or "a banner in the app").
Help me write a one-page "We lost data" plan for my app. Don't change anything. Write it in short, numbered steps a stressed person can follow. Use names and places only, never passwords, keys or connection strings.
My backup plan: [MY BACKUP PLAN]
My restore note: [MY RESTORE NOTE]
Who else should know: [WHO ELSE SHOULD KNOW]
How I reach my users: [HOW I REACH MY USERS]
The page should cover:
1. The first 10 minutes: stop whatever is deleting or changing data (scripts, scheduled jobs, AI agents), and don't restore anything yet.
2. Write down what's missing, when it was last seen, and what changed just before.
3. Where every backup lives: Supabase's backups page, my own copies, my file copies, and the GitHub Actions run history.
4. Which recovery to try first, based on my plan: getting back only the missing rows (Prompt 4.1 of this pack) before a full restore.
5. When to contact Supabase support, and what to have ready.
6. What to tell users, if they'll notice, with a short, honest note I can adapt.
7. Afterwards: what caused it, and one change so it can't happen the same way again.
End with a 3-line box I could stick on my wall: where my backups are, the first thing to do, and the first thing NOT to do.
Tips to customize: Keep a copy of this page outside your app and outside Supabase, like a printout or a note on your phone, since you might not be able to log in on the bad day. Read it once every few months when you do your restore drill, and fix anything that's out of date. If someone else helps run your app, walk them through it once.
Get new free packs in your inbox
Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.
Thanks, you're on the list. Watch your inbox for the next prompt drop.