18 days ago
My SQLite database on Railway (mounted via a volume) became corrupted (“database disk image is malformed”).
I’ve successfully recovered a clean backup locally using SQLite recovery tools, and the data looks intact.
However, I’m unsure how to restore or upload this fixed database back into a Railway volume and remove the corrupted one, since there’s no direct file upload option in the UI.
What’s the recommended way to replace or restore a database file inside Railway volume?
3 Replies
18 days ago
Hey! sorry you ran into this.
The easiest way to get your file back into your service is probably using Railway's SSH features!
If you've added your SSH keys to your railway account, you can use scp to copy your file over to the service from your computer.
if your file is called database.db you could do something like scp database.db your-services-domain@ssh.railway.com:/your/volume/path
We have docs on our SSH features here too for reference
Let me know if you run into any trouble- in the future I'd recommend either using our volume backups feature to do regular volume backups, or maybe a third party backup tool for SQLite like Litestream that you can use to stream backups to a Railway bucket 🙂
Thank you, this really helped but it took hours. I wish there was an option to upload and remove files from a Railway volume directly! We just got the Pro Plan for the backup feature.
18 days ago
Ah! sorry to hear it took awhile. I'd definitely love to see an in-product file browser as well.
I'd encourage you to go upvote and leave your use-case on this existing request for a volume browser if it's something you want to see! I know we do plan on providing some sort of primitive for it eventaully as part of the project.