How to Migrate Local PostgreSQL Database to AWS RDS

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:

img

Click on the folder icon available in the file name section:

img

Type the name of the file and its format before clicking on the “Save” button:

img

Select the path of the file with its format and click on the “Backup” button:

img

The backup has been created successfully:

img

Head into the RDS dashboard from the AWS Management Console:

img

Visit the “Databases” page from the left panel:

img

Click on the name of the RDS database:

img

Copy the “Endpoint” of the RDS database from the “Connectivity & security” section:

img

Head back to the “pgAdmin” dashboard to right-click on the servers button to register a new server:

img

Type the name of the server in the “General” page:

img

Head into the “Connection” page to paste the endpoint of the RDS database with username and password and click on the “Save” button:

img

Once the connection is established, right-click on the name of the database, and click on the “Restore…” button:

img

Type the format and path of the file to restore the database and click on the “Restore” button:

img

The process has been completed successfully and the database is restored:

img

The database has been migrated successfully from the local PostgreSQL to the AWS RDS:

img

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.