I urgently need to restore a postgres databse

How can I restore my database using railway's automatic backups?
47 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
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
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
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
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
what version am I using How do I tell what version I used I made the backup two days ago
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
No
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
How do I do that
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
mac
Faraz
Faraz•2y ago
pg_dump --version
WilsonSquared
WilsonSquared•2y ago
14.2
Faraz
Faraz•2y ago
and restore?
WilsonSquared
WilsonSquared•2y ago
Same What do i do now. This is horrible
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
It's not sensitive at all. I can send it to you even
Faraz
Faraz•2y ago
Is this for Senja?
WilsonSquared
WilsonSquared•2y ago
Yes
Faraz
Faraz•2y ago
It seems like your DB is fine? Are you trying to restore prod to staging?
WilsonSquared
WilsonSquared•2y ago
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
Faraz
Faraz•2y ago
Right. Could you DM the backup to both Wyzlle and I? We'll see if something can be done.
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
Just sent it to both of you Anything I can do in the meantime?
Faraz
Faraz•2y ago
Give us a bit, that's all. Did restoring fail immediately for you? Or was it partially working?
WilsonSquared
WilsonSquared•2y ago
It failed immediately with the error above
Faraz
Faraz•2y ago
I've just invited you to a Railway project where I've restored the data. Can you check if that's accurate?
WilsonSquared
WilsonSquared•2y ago
Where did you send the invitation?
Faraz
Faraz•2y ago
To the same email address you use on Railway.
WilsonSquared
WilsonSquared•2y ago
I haven't received it yet
Faraz
Faraz•2y ago
I'll delete once you're in.
WilsonSquared
WilsonSquared•2y ago
Yes it is! This is perfect!!! It's the same data I was looking for
Faraz
Faraz•2y ago
Do you want me to transfer this project to you?
WilsonSquared
WilsonSquared•2y ago
Yes please
Faraz
Faraz•2y ago
Transfer initiated.
WilsonSquared
WilsonSquared•2y ago
Thank you so much. You're a lifesaver
Faraz
Faraz•2y ago
Happy to help 🙂 Just accept the transfer once you receive the email and feel free to kick me from the project after.
WilsonSquared
WilsonSquared•2y ago
Sure thing. Will do! Quick question, how can I export a csv from a table in railway?
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
WilsonSquared
WilsonSquared•2y ago
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?
Faraz
Faraz•2y ago
Working on a little something for automatic backups (a workaround). Will let you know how it goes.
WilsonSquared
WilsonSquared•2y ago
Thanks! Please do 🤘
Faraz
Faraz•2y ago
Is your restore done? Can I delete the project I had created?
WilsonSquared
WilsonSquared•2y ago
Yes completely. You can go ahead and delete it
Faraz
Faraz•2y ago
Awesome! I'll dm you on Twitter if/when we make progress on the workaround for backups 🙂
WilsonSquared
WilsonSquared•2y ago
Awesome! Thanks! Enjoy the rest of your day!