7 months ago
Description:
I am facing an issue with persistent data loss in my Strapi backend when deploying updates to the production environment on Railway. My setup consists of:
-Frontend: Flutter Web App (deployed on Railway)
-Backend: Strapi (Node.js) connecting to PostgreSQL (managed by Railway)
-Database: PostgreSQL service (managed by Railway)
-Environments: Staging and Production
Issue Explanation:
When promoting changes from staging to production, or redeploying the production backend, data stored inside the container (e.g., user uploads, local files) and any local code changes (not in version control) are lost. I understand this is due to Railway's ephemeral container system where only the PostgreSQL database persists, but local writes do not.
Other Details:
-Both environments use separate PostgreSQL databases.
-Will consider both volumes and object storage solutions, but need guidance on recommended approach for production reliability on Railway.
3 Replies
7 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 I want to enquire , data persisted during 1 deployement can be used by 2nd deployment.
🧵 Librechat from template RailWay, not connect to Bases on MongoDB
🧵 Urgent: Lost Postgres Data After Region Change (us-west1 to us-west2)
If you find the answer from one of these, please let us know by solving the thread!
7 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open itsrems • 8 months ago
7 months ago
This issue remains unresolved—deploying new code on our production Railway container would wipe all user data and runtime changes, putting our production at risk. We urgently need clear guidance from the @railway team on how to persist user uploads and prevent data loss during deployments. Please advise with a reliable, production-ready solution.
adarshgn4th
This issue remains unresolved—deploying new code on our production Railway container would wipe all user data and runtime changes, putting our production at risk. We urgently need clear guidance from the @railway team on how to persist user uploads and prevent data loss during deployments. Please advise with a reliable, production-ready solution.
7 months ago
So you are saying on the production server when a new deployment is created all the data previously stored on that service is wiped ?
Use a volume, that's what they are meant for.
You could also use object storage if you wanted to persist data across environments (staging -> production).
Either option is fine, volume will be quick and easy.