Vibe Code Guardian
← All posts

Database Backups for AI-Built Apps: What Happens When Nobody Set One Up

AI coding tools build features, not backups. Here is how to check whether your vibe-coded app's database is actually recoverable, set up a backup you can restore, and rehearse it before you need it.

Aaron Allen·

Database Backups for AI-Built Apps: What Happens When Nobody Set One Up

The app has been running for five months. Two hundred users, real orders, real messages. Then someone runs an AI-generated migration that includes the wrong DROP TABLE, or a support request turns into an accidental delete, or the hosting provider has a bad night.

The question you will be asked in the first minute is: when was the last backup?

If your app was built with Lovable, Cursor, Bolt or Claude Code, the honest answer is usually that there isn't one. Not because backups are hard, but because nobody's job it was. You asked the AI to build features. It built features. At no point did it create a backup, and at no point did you ask.

This post covers what to check, how to set up a backup you can actually restore, and the habit that keeps it working. Most of it takes under an hour and none of it needs you to be a developer.

Why vibe-coded apps end up with no backup

A backup is infrastructure, and infrastructure is invisible until it fails. Three things combine here.

First, the AI only builds what you describe. "Add an orders table" gets you an orders table. It does not get you a scheduled export, a retention policy or a restore plan, because those are not features anyone demos.

Second, managed platforms create a false sense of safety. If the app is on Supabase, the dashboard looks after the database for you, and it is easy to assume that includes backups. Sometimes it does. The automatic backups are tied to paid plans, and the details change, so check your plan's settings rather than assuming. Plenty of side projects are running on the free tier with nothing behind them.

Third, and this is the sneaky one: even where a platform does take automatic snapshots, those usually cover the platform's own failure, not yours. If you drop a table on Tuesday, the Tuesday snapshot may have captured the drop too. Your users' data can disappear through your own code just as easily as through the provider's.

What you are actually protecting against

It helps to be honest about the threats, because they are not the ones people imagine.

The most common one is you and your AI. A migration generated at speed, run against production because there is no staging environment, that removes a column or empties a table. We have audited apps where the only copy of the user data was the production database itself and the git history contained a migration that would have emptied it.

Second is a bug that corrupts data quietly. An AI-generated background job that overwrites a field with the wrong value every night. Nothing crashes, so nothing alerts, but the data drifts until someone notices weeks later. You need history to untangle it.

Third is the genuine incident: provider outage, account problem, a payment method lapsing and the project being paused. Rare, but when it happens with no backup, it happens completely.

A backup answers all three the same way: here is what the data looked like at a known point in time, and here is how to get it back.

What to check today

Open your database dashboard and answer these four questions. Write the answers down; they are the start of your plan.

Is any automatic backup running? If you are on Supabase, look at the plan and its backup settings. If your platform does not offer it, or you are on a plan that does not include it, that is the gap this post is here to close.

How far back does it go? A backup that only covers the last 24 hours will not help you untangle a data corruption bug that has been running for three weeks.

Has anyone ever restored from it? If the answer is no, you do not have a backup. You have a hope. More on that below.

Where does the data actually live? Some platforms snapshot only the database, not the files users upload to storage buckets. If your app stores images, PDFs or documents, those usually need their own copy.

Setting up a backup you can actually restore

The exact commands depend on your platform, so here is the shape of it rather than a tutorial. For a Supabase or other Postgres database, the standard tool is pg_dump, which exports your database to a file:

pg_dump "your-connection-string" > backup-$(date +%F).sql

Schedule it with a scheduled task on your machine, a cheap small server, or your CI system. Store the output somewhere the database is not: a different cloud provider, or your own machine plus one remote copy. A backup stored on the same platform as the database protects you from less than people assume.

Decide on retention before you start. For a small app, keeping daily backups for 30 days costs almost nothing in storage and covers the slow-corruption cases. Compress the files; SQL exports compress very well.

If your platform offers point in time recovery on a paid plan, that is worth a look. It lets you restore the database to a specific moment, which is exactly what you want after a bad migration. It costs more than a scheduled export, so weigh it against how much pain an hour of data loss would actually cause your users.

The restore rehearsal

This is the part that separates a backup from a wish. Every so often, restore a recent backup into a scratch database and check the data is there.

For a Postgres export that looks like:

createdb restore-test
psql restore-test < backup-2026-11-11.sql

Then run the queries that matter: count the users, count the orders, open the app pointed at the scratch database if you can. A common failure is a backup that exports fine but cannot be restored because of a missing extension, a version mismatch or a connection string that only works from one machine. Find that out on a quiet Tuesday, not during an incident.

Put a recurring task in your calendar for the first Monday of the month: restore the latest backup, check the row counts, done. Ten minutes.

Where this fits with the rest of launch readiness

Backups sit next to the other things AI tools do not volunteer: row level security on the database, secrets handling, error logging and rate limits. None of them appear in the feature you asked for, and all of them matter the moment real users arrive.

If you would rather not work through that list yourself, our free surface check looks at what is publicly visible about your app to start the conversation, and the launch-readiness audit goes through 137 points across 14 areas, including data and recovery, with a developer confirming every finding.

One last thing worth doing this week, even before any backup: write down, in one sentence, how you would recover if the production database vanished tonight. If you cannot write that sentence without hesitating, the backup is the right next job.

Want a developer to look at your app?

Built your app with AI tools? Run the free surface check yourself in a few minutes. Nothing to buy, and we never look at your app unless you run it.