Amazon RDS PostgreSQL gives simple methods of bringing information into the DB and sending out information from the DB. After we can effectively associate with the PostgreSQL data set we can utilize CLI apparatuses to run the import and fare orders to get the information from different sources all through the RDS data set.
The following are the means through which the PostgreSQL information movement happens utilizing the fare and import instruments.
Bringing in from an Amazon EC2 Instance
When there is a PostgreSQL worker on an Amazon EC2 occurrence and it should be moved to a RDS - PostgreSQL DB occasion, we utilize the beneath steps to do that.
Fare The Data
Make a document utilizing pg_dump that contains the information to be stacked. A dump document containing information and all the meta information of the data set is made utilizing the pg_dump utility. The accompanying order in the psql utility cerates the landfill document from the data set named mydbname.
pg_dump dbname=mydbname -f mydbnamedump.sql
Make Target DB Instance
Then, we make the objective DB case and reestablish the information into it utilizing the pg_restore order.
createdb [new database name] pg_restore -v -h [endpoint of instance] -U [master username] -d [new database name] [database].dump
Make Target Database
Use psql to make the information base on the DB case and burden the information.
psql \ -f mydbnamedump.sql \ --host awsdbpginstance.d34f4mnfggv0.us-west-2.rds.amazonaws.com \ --port 8199 \ --username awsdbuser \ --password awsdbpassword \ --dbname mynewdb