I have a 4GB local postgres database that I want to migrate to an AWS RDS database instance.
Here is what I have done:
On the aws rds console, I created a database instance called "testdatabase"
I added my IP address to a security group to allow for inbounding traffic.
I dumped my database to a file using the following command:
pg_dump -U postgres --dbname=TestDatabase -f C:\Users\lucag\Documents\Work\Data\DatabaseDumps\Descriptive_Dumps\rds\rds_initial.sql
psql -f C:\Users\lucag\Documents\Work\Data\DatabaseDumps\Descriptive_Dumps\rds\rds_initial.sql --host testdatabase.xxxxxxxxxxx.us-east-2.rds.amazonaws.com --port 5432 --username postgres --password secretpassword --dbname testdatabase
When I try to run this last command, it first tells me that "extra command line arguments: '--dbname' and 'testdatabase'" will be ignored. Then it spits out this error:
psql: error: could not connect to server: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "testdatabase.xxxxxxxxxxx.us-east-2.rds.amazonaws.com" (172.31.2.110) and accepting
TCP/IP connections on port 5432?
I do not understand this error because I would have thought that my step 2 would resolve it. In fact the security group is set up to allow all types of traffic, all protocols, and all ports from my specific IP address.
What am I missing?
In order to migrate to RDS you can use the AWS Database Migration Service (DMS) which takes care of a lot of the heavy lifting for you.
This article walks you through the steps for migrating an on-premises PostgreSQL database to Amazon RDS using AWS DMS: Migrate an on-premises PostgreSQL database to Amazon RDS for PostgreSQL
User contributions licensed under CC BY-SA 3.0