I deployed a CMS backend service on render using sqlite3 but for some reason the content data saved on Strapi backend clears out on every deployment.
Also tried the use of a persistent disk storage, and updated the ‘
DATABASE_FILENAME’ in the environment variables but it’s still clears out db on every deploy
Clearing out the content data on every deployment sounds like data is not being saved on the persistent disk.
For your specific service, please double check for the leading
DATABASE_FILENAME environment variable value. I think your application’s database file is not the same as the persistent disk’s location (which has a leading
You might find our Strapi with Sqlite repo useful for seeing how our example is configured: https://github.com/render-examples/strapi-sqlite/blob/master/render.yaml
Thanks for the response @render_dev
On my service, I have a
DATABASE_FILENAME with a value of
/data/strapi.db and a persistent disk with a mount path.
With this setup, the content still clears out on every deployment. Also with the example repo shared, I have a similar setup of strapi with my existing repo code.
I recommend looking through your application’s directories in the Shell tab to determine where your application is saving its SQLite database file. Can you confirm that the file is persisted inside the /data directory at /data/strapi.db? If not, where is the database file being saved and what is controlling the SQLite database configuration? It’s possible that your application is not respecting the
DATABASE_FILENAME environment variable.
Only changes to files in the persistent disk (mounted at /data) will persist across deployments.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.