Ask coding questions

← Back to all posts
Json File loses some data overnight

Hey so i ve created a BOT in which user data is stored in a .json file . Everything works superfine during the data and the data gets stored without any issues . But later at the night when i add some data and sleep by the morning its gone from the json file. I dont know why this is happening Anyone has a solution for this>


On replit, file changes made when a user is not in the editor are not saved, this is intentional design. If you need to store data, you should use Repl DB or an external database (such as mongodb atlas).


@RoBlockHead This is definitely not true, unless it has been changed recently. I've been storing JSON for ages and it has never once not saved. You may be thinking of Heroku as they do that.


@xfinnbar it has not changed recently, take this quote from @turbio, one of the replit engineers:

this isn’t a bug with replit, this is intended behavior. Files changed programmatically won’t be persisted unless you’re using the ide. we suggest you use instead