postgresql - import postgres db into new AWS -


i have postgres db have been able dump , restore other postgres installs without issue using:

pg_dump the_db_name > the_backup.sql 

then copy backup development server, restore with:

psql the_new_dev_db < the_backup.sql 

h/t link gem.

i've been able setup , configure ec2, s3 , eb (elastic beanstalk) installs wordpress, ruby & node js needs. however, i'm staring abyss trying import postgres db amazon rds instance. suspect not psql problem security one. suggestions on try i'd appreciate it.

i connect aws using .pem file.

i can configure pgadmin use ssh tunnel connect rds instance.

i cannot connect postgres db on aws using psql nor can configure pgadmin connect db in way aws recommends.

in both of these cases error:

psql: not connect server: connection timed out     server running on host "xxxxxxx.us-west-2.rds.amazonaws.com" (xx.xx.xx.xx) , accepting     tcp/ip connections on port 5432? 

in rds dashboard see instance part of 2 security groups. when click on 1 says:

your account not support ec2-classic platform in region. db security groups needed when ec2-classic platform supported. instead, use vpc security groups control access db instances. go ec2 console view , manage vpc security groups. more information, see aws documentation on supported platforms , using rds in vpc 

when click on other security group , go inbound tab see there 2 references show postgresql receiving tcp on port 5432

also in rds dashboard see have vpc id, but after reading article, i'm not sure way go because there no field "supported platforms."

if try restore working config in pgadmin similar message connection one:

pg_restore: [archiver (db)] connection database "ebdb" failed: not connect server: connection timed out     server running on host "xxxx.us-west-2.rds.amazonaws.com" (54.148.0.217) , accepting     tcp/ip connections on port 5432? 

finally, i've tried bring psql console in db in pgadmin. comes , can run psql commands like:

ebdb=> \conninfo connected database "ebdb" user "awsuser" on host "127.0.0.1" @ port "34883". ssl connection (protocol: tlsv1.2, cipher: xxxx, bits: 256, compression: off) 

however, if try run pg_restore here using command:

ebdb=> \! /usr/bin/pg_restore --dbname "ebdb" --section pre-data --section data --section post-data --create --clean --verbose "/home/awsuser/040517.backup" 

it not create tables or push in data. console lites , flashes sql commands , data though worked, when go pgadmin , still empty.

i able db imported above pg_restore command adding security group of elastic beanstalk server source postgres inbound traffic.

ec2 console\security groups\inbound had postgresql , port 5432 needed add security group sg-xxxx of eb server source field.

on new errors!


Comments