Strapi postgre database resets after re-deploying
arashtajdar
HOBBYOP

a year ago

the database resets to default tables and all the data lost after each deployment.

I start strapi in develop mode to be able to create the tables, then I change it into production and everything is lost.

Solved

4 Replies

brody
EMPLOYEE

a year ago

Per Strapi's docs this is not how Strapi is to be used - https://docs.strapi.io/dev-docs/faq#why-cant-i-create-or-update-content-types-in-productionstaging

You should only ever run Strapi in development mode locally.


arashtajdar
HOBBYOP

a year ago

Thanks for the reply but I don't find anything in this doc about running it on staging mode to be able to create content.
with "strapi start" command or if I leave the field empty, it will be in production mode and i'm not able to create content.


brody
EMPLOYEE

a year ago

  1. Run Strapi in development mode locally, make the changes, add content, etc.

  2. Run Strapi in production mode when on Railway, consume the content, etc.


arashtajdar
HOBBYOP

a year ago

Thanks a lot. I will try slightly_smiling_face emoji

UPDATE:

it worked.


Status changed to Solved brody over 1 year ago


Loading...