Database Back Up locally
drataullah
HOBBYOP

a month ago

I have tried to back up remote postgres railway database locally but it stucks, I have followed the blog
https://blog.railway.com/p/postgre-backup

$10 Bounty

21 Replies

Why does the slug lack an s


a month ago

Are you trying to do a one-time backup or automated backups?


a month ago

For automated backups, see this:
For a one-time backup, what's the issue you're having with the blog post above?


drataullah
HOBBYOP

a month ago

I am looking for one time local backup, and restore to other services not the native automated one


drataullah
HOBBYOP

a month ago

can you elaborate?


darseen
HOBBYTop 5% Contributor

a month ago

The only thing you need is to run the command: pg_dump -d postgresql://user:password@host:port/db_name -Fc -f /path/to/file.backup .
You can run it locally once or automate it to get your backup.


was commenting towards the link lacking an s in the slug, postgre


drataullah
HOBBYOP

a month ago

Any docs resource regarding that, I have not found any manual backup , restore related recent resources regarding the process


a month ago

The blogpost you saw above is still valid, did you try to follow the steps? What issues are you encountering?


drataullah
HOBBYOP

a month ago

yes I have followed the steps it stuck infinitely


drataullah
HOBBYOP

a month ago

This one is also have same issue


a month ago

Try the following command:

pg_dump -d  -Fc -f /path/to/file.backup

For the database URL part, substitute it with the variable named DATABASE_PUBLIC_URL on your Postgres service in Railway


a month ago

Also, if you're looking for an easy method, Railway offers backups if you're on the Pro Plan.


drataullah
HOBBYOP

a month ago

I have go this one but I need local backup of the remote database
seems above command is not working
is this command is working one?


drataullah
HOBBYOP

a month ago

I have tried the above command as well as one from the blogs, but it stucks as usual


a month ago

Try this one:

pg_dump -v -d  -Fc -f dump.backup

drataullah
HOBBYOP

a month ago

This command also ,stuck, Waiting for last 5 minutes after applying the command

I have tested the backup and restore related command 2 years back, the the command was working! but not now.Whats the issue!

1462859780279242800
1462859780698669300


a month ago

it seems that you're able to connect to your database, how big is your data? maybe it takes awhile to dump


drataullah
HOBBYOP

a month ago

After 30 minutes still file size was 0 kb, then I aborted


a month ago

could be really slow, even more if you're far away from the database (latency and all).


a month ago

Maybe that could be reduced if you spin up an Ubuntu service in the same Railway project, SSH into it, and dump it over private networking. Then you could use a web server of some sort to download it.


Loading...