HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Local Backup from Amazon RDS PostgreSQL database

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqllocaldatabaseamazonrdsfrombackup

Problem

I have a PostgreSQL database on an Amazon RDS instance.

I want to have a local dump of this instance.

So far, I've tried with this:

PGPASSWORD="Password" pg_dump -h mydb.xxxxxx.us-east-1.rds.amazonaws.com -p 5432


But it keeps throwing an error, saying that the server refuse the connection, and check if the server is actually running on port 5432, which is actually doing.

All my credentials and DB path/codes are correct.

Solution

You must be running in a Security Group firewall problem.

  • Go to your RDS Dashboard, select Instances and open the instance you want to connect to.



  • Look for a line like this : Security Groups rds-launch-wizard (sg-3e9axxx) ( active ). You should be able to click on rds-launch-wizard (sg-3e9axxx) which leads you to the EC2 Dashboard in the Security Groups panel.



  • Select your security group and open the Inbound Tab in the lower panel.



  • Click on Edit and Add Rule. Don't forget to set the Port Range to 5432 and select My IP in the source.



  • Click on Save.



  • You should be able to connect to your RDS Instance from your local IP.

Context

StackExchange Database Administrators Q#102916, answer score: 10

Revisions (0)

No revisions yet.