1

I published a project in Heroku. The text file in my project is reset every 24 hours, all data in it is lost. How do I solve the problem?

Bilal İnal
  • 39
  • 1
  • 6
  • 1
    Maybe because of this? https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted – VaibhavDN Jan 03 '21 at 17:39
  • Does this answer your question? [Can I use a file based database on Heroku?](https://stackoverflow.com/questions/50421061/can-i-use-a-file-based-database-on-heroku) – ChrisGPT was on strike Jan 03 '21 at 20:46

1 Answers1

1

You cannot.

Heroku Dynos restart every 24 hours and any file change is discarded (see Heroku ephemeral filesystem)

If you need to persist data you can use a DB (ie Postgres) or a remote storage (ie Amazon S3)

Beppe C
  • 11,256
  • 2
  • 19
  • 41