0

I'm running a discord bot which uses the quick.db npm package. Quick.db saves to a .sqlite file, which was handy since I could edit some code and restart the program without the file being completely erased. I don't want every thing in that database to erase every time I build/deploy. Is there a way to save this file?

1

Heroku uses an ephemeral file system: every time you restart your server, the files are wiped. This includes the once-per-day restart that the system performs an automatic restart. In order to save your files, you need to arrange for more permanent storage, such as AWS S3 or another service. You can read more in the help topic Why are my file uploads missing/deleted?. You can also create your own service, if you're so inclined (e.g. host a Filezilla server somewhere), but the main point is that you have to take steps to preserve your data changes. You could also use Postgres or another plugin provided by Heroku add-ons instead of using SQLite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.