Data is lost after redeploy

We need more information to help answer your question.

How do you deploy your code? Is it a Docker image or a file transfer? Has the server restarted?