If it runs in a container you need to use things like docker-compose and bind-mount the API folder. etc
If it’s a new collection.
If it’s just data you can just add data as normal.
I think you need to bind mount the uploads folder then if you are talking about “images” which people upload etc.
Else it’s stored inside the container, you remove the container the images goes, and the database entry exists.
So most of the time when people get this issue, it’s one of the following scenario:
You are running docker with development and using sqlite. To fix this make sure you are running it with production and not development Also make sure your config folder has two settings, 1 for development 1 for production.
The important thing here is, if you are using sqlite in development, when you restart the container the sqlite is deleted and recreated. Meaning you loose the data.
The data should not just delete itself.
When it comes to images not saving, it’s kind of the same scenario, but you need to bind-mount the public folder on the server so you have persistent storage. It’s recommended when using docker to not use bind mounts, rather use a upload service like cloudinary, S3 etc. to store your uploads.
This issue still persist.
I’m using PostgreSQL as database on both Mac and Ubuntu.
I don’t have any docker environment set, nor something custom outside Strapi defaults.
In my case all relations and role settings are deleted in development.
Every time I run the development environment I have to re-set all the relations again and again.
I’m currently using Strapi 4.7.1 and the issue exists from version 4.6.0 onwards.
We’re facing the same issue. Random parts of data dissappear. It’s not whole tables, just some fields, and the config part of fields. For example, when we make changes to the Content Type layout, some fields lose the config, and the content disappears as well.
We’ve had it happen 3 times in the past 4 months!!! Absolutely unacceptable. We are 100% using Postgres DB, both the DB and Strapi are hosted on Heroku. We’re using NextJS on Vercel to pull the data from Strapi and build a static site, but random parts of data disappear.
We’re even lost some images on some content types, but when I go check the files_related_morphs table, I can still see all of the images related to content types there, but it doesn’t appear in the Content Editor nor the API…
Horrible. Never using Strapi for production sites again in the future.
Thank you for your feedback @gmenih
One question I have is regarding your images. What type of provider are you using to upload images?
Are you using local upload provider by any chance ?