Pep Michael904
Pep Michael904

Reputation: 105

How can I transfer a dumped database in Postgres CLI from my remote server to my remote server or my local machine?

Normally, when I transfer a dumped database from postgres CLI in my local machine, I can simply sftp my_user_name@my_ip remotely from postgres CLI to my local machine without any problems. However, when it comes to my remote server, this seems like I have already connected with my server via ssh connection; thus, when I sudo su - postgres to open up postgres CLI, I cannot use the same technique to

i)sftp my_user_name@my_ip. It said request Connection timed out; I think this may be because they are not in the same WiFI network connection.

ii) or even sftp [email protected]. It said my aws ec2 server: Permission denied (public key)

I think this may result from I have made a SSH connection already, so if i sftp again, this will duplicate with the previous SSH connection.

Any idea ?? Please help

Upvotes: 1

Views: 79

Answers (1)

Deepak Singhal
Deepak Singhal

Reputation: 10876

it should be simple. I will help you here. Firstly are both machines on same network ? your first comment looks like they are not on same network or we can say they are not connected to each other hence connection timed out. on your second comment; u would need to use pem file to connect to ec2.. Please give all details ; and I will give you commands etc. needed. Also, check security group of destination server if port 22 is open.

Upvotes: 1

Related Questions