Skip to content
← Back to Community
node.js and sequelize using a sqlite db file, rolling back file
Profile icon
fotwenty

I seem to be having issues where my database file keeps rolling back to a previous state. I can change what ever I want and I can check and the updates happened. If I restart the changes persist. But randomly it will be as if a day of changes roll back. I also use a logger module to log to a file and that also rolls back to the same time, erasing any logs between. Any ideas?

Voters
Profile icon
fotwenty
Comments
hotnewtop
Profile icon
XDHS

Can confirm this bug feature still exists is 2022. My sqlite database file gets rolled back to a version that is several days old, loosing the most recent data. Changes to the database will only persist while you are online and signed in to Replit. Any changes to the database will be lost when you next sign in.

Profile icon
Woutervan17

@XDHS

It isnt a bug it is on purpose.

Profile icon
dt192

@Woutervan17
Does this mean that no local databases will work or just that to get them to work you need to upgrade the account to hacker and set always on?

Profile icon
XDHS

@dt192
I can't say if upgrading the account works as I still use the free tier. I changed from using SQLite to Replit's own "database": https://blog.replit.com/database. It's approximately 5x slower to read and write than SQLite but data persists between login sessions.

Profile icon
Woutervan17

@dt192

Local file databases wont work. You need to use the replit db one.

Profile icon
Learner311

I'm facing the same issue today..
How did you solve it?

Profile icon
PixelNinja

I am facing the same issue today..
How did you solve it?