Data get's deleted when strapi container restarts

I got all my content erased as well. Fortunately just launching the site and only had a few posts. My situation was that I presumed I could have two instances of strapi targeting the same Azure mySQL db. I had a prod instance in Azure App Service. It was on “version 1” lets say of my schema. It was asleep because I have it on sleep to save azure money. I worked on my strapi content for a week running strapi locally, but targeting the Azure mySQL db. In addition to creating content types I also added content. In getting ready to deploy version this “version 2” schema, I went to check on my production strapi instance and incidentally started it up. It then deleted all my content. I was thinking it would just throw errors because it didn’t have the correct schema for working with the changed db, not wipe the tables. This deletion behavior is not intuitive, and should be documented. Please comment link to documentation if it does exist.

Overall you cannot have your dev and prod env strapi instances target the same db, even if you are working on a very small project, where you dont care if prod doesn’t work while you are changing the db via dev.

I see now that the latest prescribed path is to deploy to keep env dbs content in sync is with the newer data transfer feature Data transfer | Strapi Documentation