AWS is the cloud computing service providing the platform with over 200 services to create different resources on the cloud. Its RDS service is used to create databases using multiple engines and that too with free tier-eligible resources. Setting up a new database for the AWS RDS can be a time taking process. Therefore, instead of creating or setting up a new database, Postgres users prefer to migrate the local database to the cloud RDS database.
This guide will demonstrate the migration of the local PostgreSQL database to the AWS RDS.
How to Migrate Local PostgreSQL Database to AWS RDS?
To migrate the local PostgreSQL database, right-click on the local system database and select the “Backup…” button:
Click on the folder icon available in the file name section:
Type the name of the file and its format before clicking on the “Save” button:
Select the path of the file with its format and click on the “Backup” button:
The backup has been created successfully:
Head into the RDS dashboard from the AWS Management Console:
Visit the “Databases” page from the left panel:
Click on the name of the RDS database:
Copy the “Endpoint” of the RDS database from the “Connectivity & security” section:
Head back to the “pgAdmin” dashboard to right-click on the servers button to register a new server:
Type the name of the server in the “General” page:
Head into the “Connection” page to paste the endpoint of the RDS database with username and password and click on the “Save” button:
Once the connection is established, right-click on the name of the database, and click on the “Restore…” button:
Type the format and path of the file to restore the database and click on the “Restore” button:
The process has been completed successfully and the database is restored:
The database has been migrated successfully from the local PostgreSQL to the AWS RDS:
That’s all about migrating the local PostgreSQL database to AWS RDS.
Conclusion
To migrate the local PostgreSQL database to the AWS RDS, log into pgAdmin from the local system, and create a database backup. After that, connect to the AWS RDS database using its endpoint and restore the file from the local directory. This is how the database migration can be done from the local PostgreSQL to the AWS RDS.