Database Back Up locally
drataullah
HOBBYOP

4 months 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

4 months ago

Why does the slug lack an s


4 months ago

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


4 months 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

4 months ago

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


drataullah
HOBBYOP

4 months ago

can you elaborate?


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.


4 months ago

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


drataullah
HOBBYOP

4 months ago

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


4 months ago

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


drataullah
HOBBYOP

4 months ago

yes I have followed the steps it stuck infinitely


drataullah
HOBBYOP

4 months ago

This one is also have same issue


4 months 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


4 months ago

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


drataullah
HOBBYOP

4 months 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

4 months ago

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


4 months ago

Try this one:

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

drataullah
HOBBYOP

4 months 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!

1462859780279242772

1462859780698669289


4 months 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

4 months ago

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


4 months ago

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


4 months 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.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...