Postgresql 将postgres db导入新AWS

Postgresql 将postgres db导入新AWS,postgresql,amazon-web-services,amazon-ec2,amazon-rds,Postgresql,Amazon Web Services,Amazon Ec2,Amazon Rds,我有一个postgres db,我可以通过以下方式将其转储并还原到其他postgres安装: pg_dump the_db_name > the_backup.sql 然后将备份复制到您的开发服务器,使用以下方法进行恢复: psql the_new_dev_db < the_backup.sql 在rds仪表板中,我看到我的实例是两个安全组的一部分。当我点击其中一个时,它会说: Your account does not support the EC2-Classic Platf

我有一个postgres db,我可以通过以下方式将其转储并还原到其他postgres安装:

pg_dump the_db_name > the_backup.sql
然后将备份复制到您的开发服务器,使用以下方法进行恢复:

psql the_new_dev_db < the_backup.sql
在rds仪表板中,我看到我的实例是两个安全组的一部分。当我点击其中一个时,它会说:

Your account does not support the EC2-Classic Platform in this region. DB Security Groups are only needed when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your DB Instances. Go to the EC2 Console to view and manage your VPC Security Groups. For more information, see AWS Documentation on Supported Platforms and Using RDS in VPC
当我单击另一个安全组并转到其入站选项卡时,我看到有两个引用显示Postgresql正在端口5432上接收TCP

另外,在RDS仪表板中,我看到我有一个VPC ID,我不确定该怎么办,因为没有“支持的平台”字段

如果我尝试从pgAdmin中的工作配置进行恢复,我会收到与连接类似的消息:

pg_restore: [archiver (db)] connection to database "ebdb" failed: could not connect to server: Connection timed out
    Is the server running on host "XXXX.us-west-2.rds.amazonaws.com" (54.148.0.217) and accepting
    TCP/IP connections on port 5432?
最后,我尝试在pgAdmin中的db中启动PSQL控制台。它出现了,我可以运行psql命令,如:

ebdb=> \conninfo
You are connected to database "ebdb" as user "awsuser" on host "127.0.0.1" at port "34883".
SSL connection (protocol: TLSv1.2, cipher: XXXX, bits: 256, compression: off)
但是,如果我尝试在此处使用以下命令运行pg_restore:

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

它不创建任何表或推入任何数据。控制台启动并闪烁所有SQL命令和数据,就好像它工作了一样,但当我返回pgAdmin并查看时,它仍然是空的。

通过添加elastic beanstalk服务器的安全组作为我的postgres入站流量的源,我能够使用上面的pg_restore命令导入db

EC2控制台\安全组\入站 我有PostgresQL和端口5432,但需要将eb服务器的安全组sg xxxx添加到源字段中

新的错误

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