---
title: "The agent ran a migration and my data is gone"
description: "An AI migration dropped a column or table and the rows went with it. How to check which backups exist on Supabase, Lovable Cloud or Replit and restore."
url: https://whocanfixmyapp.com/problems/agent-ran-a-migration-and-my-data-is-gone
---

[Home](https://whocanfixmyapp.com/) / [Problems](https://whocanfixmyapp.com/problems) / [AI loops and credits](https://whocanfixmyapp.com/problems#ai-loops-and-credits)

# The agent ran a migration and my data is gone

VC-06 · Supabase · Replit · Lovable · Updated October 2026 · By [Nathaniel Kelley](https://whocanfixmyapp.com/authors/nathaniel-kelley)

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](https://whocanfixmyapp.com/pricing))
- **Top rated for Supabase**: [Redlab](https://whocanfixmyapp.com/companies/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](https://whocanfixmyapp.com/problems/replit-agent-stuck-or-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](https://whocanfixmyapp.com/methodology#score).

- 1 · [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10 · Best for: A full rescue by one team that keeps building · Free first step · from $490
- 2 · [Vibe Code Rescue (Lev Arakelyan)](https://whocanfixmyapp.com/companies/vibe-code-rescue-lev-arakelyan) · **9.0**/10 · Best for: A one-off check and a cleanup · From $299
- 3 · [LazyCodeLab](https://whocanfixmyapp.com/companies/lazycodelab) · **9.0**/10 · Best for: A one-off check and a cleanup · From $399

[All 29 Supabase companies, ranked](https://whocanfixmyapp.com/best/supabase-developers)

## Check these

OPS-01 · Critical

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-02 · High

Testing and real users use separate databases

Experiments and AI agents should never run against production data.

CODE-01 · High

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-01 · Critical

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](https://supabase.com/docs/guides/platform/backups); [Lovable: Back up and restore your database](https://docs.lovable.dev/features/database-backups); [Lovable: Database and migrations](https://docs.lovable.dev/features/database); [Replit: Data recovery](https://docs.replit.com/features/data-and-storage/data-recovery).

**Lovable guide**

What Lovable builds, where it breaks and how to check it: [Lovable app rescue: what breaks and how to check it](https://whocanfixmyapp.com/guides/lovable).

**Same category**

- [Lovable keeps saying it fixed the bug: how to get out of the loop without burning credits](https://whocanfixmyapp.com/problems/lovable-stuck-in-a-fix-loop)
- [Replit agent stuck in a loop or deleted my data: what to do now](https://whocanfixmyapp.com/problems/replit-agent-stuck-or-lost-data)
- [Bolt keeps breaking what it just fixed](https://whocanfixmyapp.com/problems/bolt-keeps-breaking-what-it-just-fixed)
- [Replit Agent burned my credits and the app still doesn't work](https://whocanfixmyapp.com/problems/replit-agent-burned-credits-nothing-works)
- [Cursor or Claude Code rewrote files and the app stopped working](https://whocanfixmyapp.com/problems/cursor-or-claude-code-rewrote-files-app-stopped-working)
- [My app worked yesterday and I changed nothing](https://whocanfixmyapp.com/problems/app-worked-yesterday-nothing-changed)

[All ai loops and credits problems](https://whocanfixmyapp.com/problems#ai-loops-and-credits)

**Run every check**

The [production checklist](https://whocanfixmyapp.com/checklist) has all 24 checks with a verdict.
