I recently switched from using a self-hosted Strapi JavaScript version to Strapi Cloud. When I was transferring data, I faced some problems because of the integrity checks, but it was resolved by bypassing the checks in Strapi Core.
Currently, I’m experiencing an issue where every time I make changes to Git and redeploy Strapi to the cloud, it deletes all the data. I’m not using any database configuration on Strapi Cloud, and I’d like to know if this is expected behavior.
Moreover, I’d like to know if it’s possible to use an external database or keep the data after each deployment. If there’s a solution to this problem, please let me know.
By default, it should create a PostgreSQL Database which will retain data. However, if you somehow managed to set up an SQLite database, that would be the expected behaviour.
I’m not a Strapi Cloud user by the way, this is my experience with self-hosted.
I’m not sure where Strapi Cloud is hosted but you would benefit heavily by keeping the database as close to the service as possible for performance reasons.
When you say the data is deleted, is it everything like a fresh Strapi installation or is it some content-type data only?
Can you provide some details from your logs with your database debug set to true?
When I rebuild the project, it is likely that the Strapi instance is completely reset to its default state, which includes deleting all data and resetting to the initial state of the application (i.e. fresh Strapi installation).
No I only use one file for it, somehow strapi is not picking up the sql database configurations which I defined in database.js, instead it is storing all schema/data into sqlite, which results in deleting data
Never share development and production database.
If you change the schema in development you theoretically rename and or delete the data in production.
Better practice then to use this
Where you can say in development use database X and in production use database Y
So you separate the environment with two separate files.
Okay, I have another question. Does Strapi Cloud support MySQL? I noticed that the prerequisites list on the Strapi Cloud - Your Headless CMS Managed for You page only mentions PostgreSQL as a supported database