whocanfixmyapp

Home / Problems / AI loops and credits

The agent ran a migration and my data is gone

VC-06SupabaseReplitLovableUpdated October 2026By

Quick verdict

Partly fixable yourself. Only if a backup or checkpoint exists. Act now.

How serious
Critical
Fix it yourself?
Partly, some steps need a developer
Typical cost
$49–$800 one-off check, or €99–$990 for a single fix (prices)
Top rated for Supabase
Redlab · 10.0/10

What you see. After the AI ran a database change, a table or its rows are empty and user records are missing.

Why it happens

A migration is a script that changes the database structure. Dropping a column, renaming a table or changing a column type can throw away the data inside it. AI agents often pick the simplest migration that makes the code compile, and the simplest one is sometimes destructive. Lovable blocks these by default, with a permission called Execute backward incompatible database migrations set to Never allow, but a founder who switched it to Always allow loses that guard.

Whether the data is recoverable depends on backups. Supabase runs daily backups only on Pro, Team and Enterprise plans, and Free plan projects have none unless you exported. Replit keeps checkpoint history for the development database but says Agent cannot modify the production database, which uses its own point-in-time restore. Lovable Cloud takes one backup a day and keeps about 14 days. Rolling back code never restores data on any of these platforms.

Fix it yourself

  1. Stop the agent now and make no more database changes. Every write after the loss makes a clean restore harder.
  2. Supabase: in the dashboard open Database → Backups, pick the latest backup made before the migration, and restore. The project is offline during the restore.
  3. Lovable Cloud: open More → Database → Manage → Backups and click Restore to this backup. This replaces the whole database and cannot be undone.
  4. Replit: open the Agent tab, pick the checkpoint before the migration, select Rollback to here and tick Database. For the production database, use point-in-time restore in its settings.
  5. After the restore, check that the code matches the restored schema. Revert the code to the same moment if columns no longer line up.
  6. Export a copy of the database before you touch anything else, so a second mistake is not fatal.

When to get an engineer

Hire today if there is no backup, if the restore window has passed, or if customers already wrote new data you must keep. An engineer can sometimes rebuild rows from logs, storage objects or a restore to a new project, then merge. Send them the migration SQL, the exact time it ran and your plan tier. A one-off recovery check is $49–$800. A targeted fix with data merge is €99–$990. See Replit Agent lost data for that platform.

Top-rated companies for Supabase apps

Ranked by our score: published prices, scope of work, AI tools named, timing and a low-risk first step. How we score.

  • 1Redlab10.0/10Best for: A full rescue by one team that keeps buildingFree first step · from $490
  • 2Vibe Code Rescue (Lev Arakelyan)9.0/10Best for: A one-off check and a cleanupFrom $299
  • 3LazyCodeLab9.0/10Best for: A one-off check and a cleanupFrom $399

All 29 Supabase companies, ranked

Check these

OPS-01Critical

Database backups run automatically and a restore has been tested

Check what your database plan actually includes, then restore a backup into a test project once.

OPS-02High

Testing and real users use separate databases

Experiments and AI agents should never run against production data.

CODE-01High

The code lives in a Git repository you own

Connect GitHub or export the project. If the builder account is lost, the product should not be.

DATA-01Critical

Access rules are on for every table

In Supabase, open Table Editor: every table should show RLS enabled, with at least one policy. In Firebase, your rules should never say allow read, write: if true.

Questions

I am on the Supabase Free plan. Is the data gone?

Supabase does not take daily backups on the Free plan and recommends regular exports. If you never exported, the rows in the dropped column or table are not recoverable from Supabase.

Will reverting my Lovable project bring the data back?

No. Lovable's history page says reverting restores code and edge functions but does not roll back database data. Use the Backups screen instead.

Sources: Supabase: Database backups; Lovable: Back up and restore your database; Lovable: Database and migrations; Replit: Data recovery.