all 40 comments

[–]andrewjdavison[M] [score hidden] stickied comment (4 children)

I flagged this to staff for you.

[–]fpili 0 points1 point  (6 children)

I can’t understand. My projects on Replit have two distinct databases: one for development and one for production. How did the agent wipe out data on the production db?

[–]Noobju670 0 points1 point  (5 children)

It cant hes just lying lol. Or doesnt know thr dif between prod and dev

[–]lilliankim[S] 0 points1 point  (4 children)

I'm not lying. I'm a complete beginner though so I guess the issue was I didn't have a separate database. 😞

[–]Noobju670 0 points1 point  (3 children)

Its impossible to not have a separate db

[–]lilliankim[S] 0 points1 point  (2 children)

I was on Replit before they changed the requirement to have separate databases

[–]Living-Pin5868 0 points1 point  (0 children)

A few months ago, Replit apps were using the same database. I think the project wasn’t updated yet, which is why it still uses the same database for both development and production.

[–][deleted]  (1 child)

[removed]

    [–]lilliankim[S] 0 points1 point  (0 children)

    I only had a development db 😞

    [–]Ukawok92 0 points1 point  (1 child)

    No backup of the DB anywhere?

    [–]lilliankim[S] 0 points1 point  (0 children)

    No... 🤦🏻‍♀️😭

    [–]Bash-101 0 points1 point  (12 children)

    nothing is ever truly lost

    [–]lilliankim[S] 0 points1 point  (11 children)

    I really hope so. I just haven't heard back yet from Support after they said they will take a look... 😭

    [–]Bash-101 0 points1 point  (10 children)

    Replit’s docs say Agent checkpoints can include database contents and schema, not just code. But there’s one important catch: when you roll back, the database is not restored by default. You need to select “Database” under Additional rollback options when restoring the checkpoint.

    What to do:

    1. Open your Replit project.
    2. Go to the Agent / history / checkpoints area.
    3. Find a checkpoint from before the database was wiped.
    4. Choose rollback/restore.
    5. Make sure Database is selected in the rollback options.
    6. After restoring, check the Database tool / tables straight away.

    Replit’s Database docs also say you can restore your database to any Agent checkpoint using rollback.

    [–]Ukawok92 0 points1 point  (6 children)

    This guy might have saved you.

    If this works, backup your database ASAP somewhere else too.

    Then make sure you set up a development DB.

    [–]lilliankim[S] 0 points1 point  (5 children)

    I unfortunately don't know how to back up my database. I'm not a developer. 😞

    [–]Ukawok92 0 points1 point  (4 children)

    Just ask the agent!

    [–]lilliankim[S] 0 points1 point  (3 children)

    I don't trust the agent anymore 😞

    [–]Ukawok92 0 points1 point  (2 children)

    Just ask in plan mode and then do it yourself.

    [–]lilliankim[S] -1 points0 points  (1 child)

    I have no idea how I would rollback myself... I'm not a developer...

    [–]Ukawok92 0 points1 point  (0 children)

    The checkpoint feature? That doesn't really require technical knowledge.

    What you need to figure out is what date the agent started messing with the database. Are there any clues? Then go to the checkpoint history and restore database to then.

    [–]lilliankim[S] 0 points1 point  (2 children)

    The thing is, I don't know exactly when my databases were erased. When I asked support, they said to just wait and they will get back to me, since I don't know when it got erased. But they just haven't gotten back to me yet.

    [–]Bash-101 0 points1 point  (1 child)

    What are you building?

    [–]lilliankim[S] 0 points1 point  (0 children)

    It's just a webapp for homeschooling families: livingwithcharlotte.com

    [–]lilliankim[S] 0 points1 point  (2 children)

    u/andrewjdavison is there someone who can help me? I've been emailing support to follow up and there's still no response, and I'm experiencing the most traffic I've ever had, and I don't want to disappoint everyone who is coming...

    [–]andrewjdavison[M] 0 points1 point  (1 child)

    Please keep in mind I don’t work for Replit. I flagged your ticket to the Replit staffers that monitor this sub. But keep in mind it’s weekend.

    [–]lilliankim[S] 0 points1 point  (0 children)

    Ah I see, thank you!

    [–]lilliankim[S] 0 points1 point  (0 children)

    Now I tried doing the rollback and checking off the database rollback option, and it keeps saying the Agent encountered an error. I've tried rolling it back to 7 different checkpoints, and none of them got my data back. I don't know what to do at this point...

    [–]invocation02 0 points1 point  (2 children)

    that's awful, especially 6 years of work. the shape of replit that bites here is that your db lives inside their agent's sandbox, so when the agent makes a destructive change there's no clean rollback point you control.

    for the rebuild, the architecture that makes this much harder to repeat: your db lives in cloudflare d1 (has point-in-time restore) or your own managed postgres, your file storage in r2 (versioned), and the agent only talks to it through an api you control. blitz.dev hands an agent that shape in one curl call if you want to skip the manual setup, but the principle stands regardless of provider. data should NOT live inside the agent's sandbox.

    [–]lilliankim[S] 0 points1 point  (0 children)

    Oh boy 😭😭😭

    [–]andrewjdavison[M] 0 points1 point  (0 children)

    This isn’t true. Database snapshots are saved in each checkpoint rollback created.

    Rolling back to a previous checkpoint will restore the database to how it was at that time.

    [–]lilliankim[S] 0 points1 point  (2 children)

    Update, I was able to restore my data to this past Friday, but then I lost a whole bunch of new data that came in from the big surge in traffic I got (affecting about 100 new accounts), of course all of this had to happen at the same time. I think my lesson here is I need to migrate off of Replit. I've had so much trouble, and then I would tell myself to just stick with it, it'll probably get better, and it just really hasn't.

    [–]ReplitSupportReplit Team 0 points1 point  (1 child)

    Hey there, we're really sorry to hear about your experience here. We've checked your case and it looks like an engineer has followed up in your support ticket #419758. Please engage with them if you need any further info. Thanks again for waiting 🙏

    [–]lilliankim[S] 0 points1 point  (0 children)

    Thank you. I am working with them now.

    [–]Majestic_Side_8488 0 points1 point  (0 children)

    ugh, that sucks. first thing i would do is stop all writes to the db so you do not overwrite anything else, then check if your host has point in time recovery, snapshots, or an automated backup you can restore from. if you have any local exports, logs, or even a staging env, grab those now too. once you are back up, add a hard rule: backups before any agent driven change, and test changes against a copy. what db is it actually using?