How To Migrate MySQL Database Hosted On An EC2 Instance To Amazon RDS?

Comments · 93 Views

Scaling an EC2-based database involves manual intervention to adjust compute and storage resources which leads to downtime during scaling operations and requires careful planning to accommodate changing workloads. Achieving high availability for a database on EC2 typically involves setting

We were handling all these difficulties within our organisation so in order to overcome we decided to migrate to fully managed service like Amazon RDS which provides cost-efficient, high availability features with automated failover, resizable capacity for an industry-standard relational database and manages common database administration tasks.

AWS Database Migration Services help us to migrate databases whether it is (Homogeneous/Heterogeneous ) to the cloud in a very simple manner as per the requirements with minimal downtime.

To know more about AWS DMS you may follow the link below: Database Migration Service in AWS

In this blog post we will see the hands on of MySQL database migration from Elastic Compute Cloud to Amazon RDS by using Amazon Database Migration Service its various available features.

So, let’s start at the beginning…

Launch an EC2 instance and install MySQL Database ( Source ) into it by following these links https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/option3-task1-launch-ec2-instance.html ,

https://phoenixnap.com/kb/install-mysql-ubuntu-22-04

Create MySQL Database ( Target ) within Amazon RDS by following this link https://aws.amazon.com/getting-started/hands-on/create-mysql-db/

Create a Replication Instance

Open the AWS Console, search for Database Migration Service and choose Replication Instances from the navigation pane. Then choose to “Create a replication instance”, as shown

Select the same VPC in which you have EC2 RDS instance for the replication instance as well , in order to avoid the need of peering connections.

Then go to the Security Groups section in the Amazon EC2 console. You need to check whether your security group allows your replication instance to access your database. In the Security Groups section, find the security group which is same for both MySQL database instances ( EC2 RDS ) and your replication instance, and choose it.

If your security group has an existing rule that allows for access to your MySQL database instance then enter the “name of the security group” used for your Amazon RDS database instance and replication instance in source instead of any IP address

Creating Target and Source Endpoints

Target endpoint

First, create the endpoint for your target database. Navigate to the Endpoints section of the AWS DMS console. Choose “Create endpoint” to create a new endpoint, as shown

Source endpoint

Follow these same steps again to create an endpoint for your source database, as shown .

Here You can find more info about- Aws ConsultingCloud Migration Services, KubernetesServices.

 
 
 
Comments