Migration Of MS SQL From Azure VM TO Amazon RDS

MS SQL Migration Azure VM to Amazon RDS

Overview

Recently I am working with the client using Azure Cloud for their application and the microsoft SQL server is hosting on a virtual machine so they found the need to migrate the application from Azure to AWS due to some amazing features and services of it which would be very helpful to enhance the app & it’s functionalities.

So in order to do that my client decided to migrate the Database from VM to Amazon RDS in order to release the burden of its management along with all related tasks too, since it’s quite difficult to manage a database on a VM & on the other hand as Amazon RDS is a fully managed service & a better platform for running relational databases on Amazon Web Services (AWS).

In this article we will do the hands on of migrating Microsoft SQL server from Azure VM to Amazon RDS by using AWS Database Migration Service with minimal downtime.

To know more about AWS DMS you may follow the link below : https://opstree.com/blog//2023/06/20/database-migration-service-in-aws/

Prerequisites


1. Azure VM With MS SQL Installed , Follow the below link for the same.

( https://discourse.ubuntu.com/t/microsoft-sql-server-2019-on-ubuntu-20-04/21943 )

( https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu )

This Azure VM With Microsoft SQL Server Installed & In Running State

Install the command line tools to interact with it

2. Site To Site VPN Established Connection Among Both Clouds

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

Let’s get hands dirty here

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”, provide the required details as shown below.

After you click on the “Create replication instance” button, AWS provisions your replication instance. When your replication instance is ready to run, its status is “Available”, as shown.

Note: Go to the Security Groups section in the Amazon EC2 console & Azure VM. You need to check whether your security group allows your replication instance to access your RDS target database and Source database. Set the rule accordingly.

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

Click on the “Run test” button to test the target endpoint. After a few seconds, you should see a Status of successful. After seeing the status value is “successful”, click on the “Create endpoint” button .

We have successfully created target endpoint now

Source endpoint

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

Both EndPoints Have Been Created Successfully.

Creating a Migration Task

A migration task is responsible for migrating data from a source database to a target database. In order to start, navigate to the Database migration tasks section of the AWS DMS console. Choose “Create task” to create a new Database migration task, as shown below.

Here we can see that the migration process has been successfully completed

Monitoring and Checking The Migration Task’s Output

By Using Amazon Cloudwatch Logs

Navigate to the “Overview details” section in DMS Task, and then click on the “View Cloudwatch Logs”,

These logs provide full details about the migration.

By Using Azure Data Studio

To Install Azure Data Studio you may follow the link below. https://database.guide/how-to-install-azure-data-studio-on-ubuntu-20-04/

 

AWS Database Migration Service pricing

Data Migration Service is a free migration solution for switching to DocumentDB, Redshift, Aurora, or DynamoDB. You must pay for other databases based on the volume of log storing and the computational load.

When migrating your source database to a destination database in a different Availability Zone, Region, or outside of AWS, standard AWS data transfer rates apply.

To get further details about the pricing please go through the link below . https://aws.amazon.com/dms/pricing/

Conclusion

We migrated a MS SQL Database to Amazon RDS by using AWS DMS. To do this, we created a target “RDS MySQL Database”, a replication instance, target and source endpoints, and a migration task. Finally, we monitored our database migration by using Cloudwatch logs & Azure Data Studio . It took me around 15-20 minutes to complete the whole migration process as the time is totally depends upon the amount of data we have for the migration.

🙏 Thank you for reading this blog.

Before you go:

Clap if you liked it 👏, comment and share this article to reach more community 🧞.

One thought on “Migration Of MS SQL From Azure VM TO Amazon RDS”

Leave a Reply