Demo, all content is generated
Question

Rolled back to a Replit Agent checkpoint, did it also roll back my database?

Open · 262 views · asked by lucas_moreau · edited

Agent broke the login flow so I rolled back to a checkpoint from 2 hours earlier. Code is fine now. But I also had created 3 test users in between and they are gone. I'm fine with test users but I'm about to launch and I want to know: if I roll back later with real users in there, do they disappear too?

What I’ve tried

Read the rollback popup (it had some checkboxes I didn't really read) and searched the docs, found conflicting info from different dates.

Comment
Were the 3 users in the development database or did you create them on the published app? olu_backend · edited
in the workspace preview, so dev I guess lucas_moreau · edited

3 answers

hannah_reyes · edited

Rollback can restore the development database together with the code (that's the checkbox you saw). That's why your test users vanished.

The published app should use its own production database, separate from dev, and a workspace rollback doesn't touch that. But verify it for your project before launch: look in the Database pane whether you see a separate production database, and check which DATABASE_URL the deployment uses.

Whatever the answer: set up your own backup before real users arrive. A nightly pg_dump to somewhere outside Replit costs nothing and you'll sleep better.

Comment
ok I see 'production' as a separate thing in the pane. Will set up the dump lucas_moreau · edited
abdul_r · edited

From experience: I once rolled back with the DB option unticked and the code expected a column that no longer existed. So even if the data stays, a rollback can leave code and schema out of sync. Test after every rollback.

Comment
fatima_z · edited

Before launch, also export your tables as CSV from the Database pane once in a while. Not a real backup strategy, but better than nothing while you set one up.

Comment