I can't extract data from postresql
Anonymous
FREEOP

a month ago

I used to just enter a similar command in cmd and it worked, but now I get an error and can't do anything

pg_dump: error: connection to server at "reseau.proxy.rlwy.net" (66.33.22.224), port 31709 failed: Connection timed out (0x0000274C/10060)

    Is the server running on that host and accepting TCP/IP connections?

I tried using VPNs from different countries, but it didn't work

Solved$10 Bounty

Pinned Solution

Try running this in console: pg_dump -U postgres -h localhost -d railway > dump.sql

25 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 29 days ago


Make sure your Postgres service is running and healthy.


Also, you can run pg_dump from the console tab of your service, then download the dump file directly from the filebrowser. It might be faster that way.


Anonymous
FREEOP

a month ago

my database is crashing even though there is data in the variables, and I can't download the data because of this


What are the errors being thrown?


Anonymous
FREEOP

a month ago

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/f4a153fe-3292-418b-8f1a-05767b6079b4/vol_ofn60390g61cnd9l

ERROR: BOT_TOKEN not found in configurations

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/f4a153fe-3292-418b-8f1a-05767b6079b4/vol_ofn60390g61cnd9l

ERROR: BOT_TOKEN not found in configurations

although there is this token and it worked just yesterday, today when I wanted to transfer data to a local PC, it started giving this error


That's what the Postgres logs are showing?


Anonymous
FREEOP

a month ago

yes


You need to recreate your Postgres instance then.

  1. Delete the current Postgres service (Don't delete the volume)
  2. Right click on your canvas and create a new Postgres instance
  3. After it's deployed, drag the old volume onto the new instance to swap volumes (the new volume can be deleted)

Anonymous
FREEOP

a month ago

So, without recreating, it won't be possible to download data from the database?


It's possible you accidentally ran railway up into your database service.

Either way, the image on your database service isn't what it's supposed to be, so you'd need to recreate the service.


Anonymous
FREEOP

a month ago

and if I do something wrong, is it possible to roll back the changes?


The steps are pretty straightforward. It would be quite hard to accidentally delete your volume.


Anonymous
FREEOP

a month ago

I've done a good job, but now how can I get the data from this database to make it work?


You can run pg_dump (2) from the console tab (1) by clicking on your database. You'll then be able to download the dump file from the filebrowser (3) below.

47819.png

Attachments


Anonymous
FREEOP

a month ago

for some reason, the file is downloaded empty, even though there is data


Anonymous
FREEOP

a month ago

Or am I doing something wrong?


Did you swap the old volume onto the new volume?


Anonymous
FREEOP

a month ago

It's like you said


If you go to the Database tab, is there any data there?


Anonymous
FREEOP

a month ago

yes, maybe I'm doing something wrong


Try running this in console: pg_dump -U postgres -h localhost -d railway > dump.sql


Anonymous
FREEOP

a month ago

Thank you very much you are the best


Did that do it?


Anonymous
FREEOP

a month ago

yes

ilove u


Good to know haha


Status changed to Solved 0x5b62656e5d 29 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...