Would i lose data if i restart the container?
Anonymous
HOBBYOP

5 months ago

I have a postgres service with my production database, since the outage i havent been able to connect and my app is down. I saw that restarting the service can fix the problem i would like to know if there is a chance that i lose my data doing that. thanks in advance.

Solved

3 Replies

5 months ago

If you deployed the template postgres that we provide you shouldnt lose any data no!

It uses a persistent volume.


Status changed to Awaiting User Response Railway 5 months ago


noahd

If you deployed the template postgres that we provide you shouldnt lose any data no! It uses a persistent volume.

5 months ago

I'm losing my data from my tables when I restart and redeploy, tables are there but no data, I was going to reach out today and saw this post


Status changed to Awaiting Railway Response Railway 5 months ago


sam-a
EMPLOYEE

5 months ago

Based on what I see, I think you may have resolved the issue already, but let us know if you have not.

Data persistence on Railway requires a volume attached to the service, mounted at the correct path - for Postgres, that's /var/lib/postgresql/data. If data is disappearing on restart while tables remain, the volume may not be attached or may be mounted to a different path than where Postgres stores its data. I notice you have two volumes in your project, so maybe the right one was not attached?


Status changed to Awaiting User Response Railway 5 months ago


Railway
BOT

5 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 5 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...