Avoiding resetting all of the data on deploy

Is there any way to avoid resetting all of the data whenever I deploy a new build of strapi?

1 Like

Hello there!

Did you by any chance set up a database (SQLite, MongoDB or Postgres) in the process of deploying your Strapi app?

Without setting up a database for your Strapi app, you will lose your data and will have to recreate the content.

Here are some hosting services and docs to configure your database before deployment: Deployment - Strapi Developer Docs

1 Like

am also encountering this issue. Don’t know why its happening.

Did you check out what the post above you just said ?

Set the DATABASE_CLIENT environment variable to the correct database:

DATABASE_CLIENT=postgres

By default it was using the local data.db file used with SQL lite, and I was wondering why the database was being erased each time I pushed to production.

const client = env('DATABASE_CLIENT', 'sqlite');