I urgently need to restore a postgres databse
How can I restore my database using railway's automatic backups?
47 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'm trying to manually restore a backup I made a few days ago, but I get this error
could not find header for file "toc.dat" in tar archive
I followed railway's instructions on making a backup, but I can't restore with the same instructions
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I didn't
I used this command
pg_dump -U postgres -h containers-us-west-65.railway.app -p 6751 -W -F t railway > backup
God I'm in serious trouble
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
what version am I using
How do I tell what version I used
I made the backup two days ago
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
No
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
How do I do that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
mac
pg_dump --version
14.2
and restore?
Same
What do i do now. This is horrible
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It's not sensitive at all.
I can send it to you even
Is this for Senja?
Yes
It seems like your DB is fine?
Are you trying to restore prod to staging?
Yes, but we accidentally deleted a few hundred rows of the production database
I made a manual backup two days ago and I wanted to restore it to the staging database
But the restore process is failing
Right.
Could you DM the backup to both Wyzlle and I?
We'll see if something can be done.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Just sent it to both of you
Anything I can do in the meantime?
Give us a bit, that's all.
Did restoring fail immediately for you? Or was it partially working?
It failed immediately with the error above
I've just invited you to a Railway project where I've restored the data.
Can you check if that's accurate?
Where did you send the invitation?
To the same email address you use on Railway.
I haven't received it yet
I'll delete once you're in.
Yes it is! This is perfect!!!
It's the same data I was looking for
Do you want me to transfer this project to you?
Yes please
Transfer initiated.
Thank you so much. You're a lifesaver
Happy to help 🙂
Just accept the transfer once you receive the email and feel free to kick me from the project after.
Sure thing. Will do!
Quick question, how can I export a csv from a table in railway?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thanks
....and restored successfully. Thank you so much for everything.
This has been the longest hour of my life so far haha
Any tips for regularly backing up my database since Railway doesn't support automatic backups?
Working on a little something for automatic backups (a workaround). Will let you know how it goes.
Thanks! Please do 🤘
Is your restore done? Can I delete the project I had created?
Yes completely. You can go ahead and delete it
Awesome! I'll dm you on Twitter if/when we make progress on the workaround for backups 🙂
Awesome! Thanks! Enjoy the rest of your day!