Skip to main content

Migration Of MS SQL From Azure VM To Amazon RDS

who is using Azure Cloud for their application and Microsoft SQL server is hosted on a virtual machine. Soon, 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 to release the burden of its management along with all the related tasks too. It’s quite difficult to manage a database on a VM. Also, Amazon RDS is a fully managed service & a better platform for running relational databases on Amazon Web Services (AWS).

Migration Of MS SQL From Azure VM To Amazon RDS

In this blog, we will do 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 : 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

https://www.netreo.com/blog/connect-azure-using-vpn-gateway-to-aws-vpc/

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 Our 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.

Here provide all the required values in the respective fields as shown below

Select the same VPC in which you have RDS instance for the replication instance as well , in order to keep seamless connectivity throughout the process.

Select the same Availability Zone for Replication Instance as in RDS Instance, Security Group

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.

[Good Read: AWS Direct Connect – A Dedicated Gateway for Migration Solution]

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 here.

Select the Target Database created in Amazon RDS.

Enter the following values for the target endpoint, as shown , in the “Username and password” boxes; enter “Username and password” of the target database that you will connect to.

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 . 

Note : In Server Name We Have To Mention Private IP Of The Azure VM i.e Source Database

Connection Has Been Established Successfully Between Source Database & Replication Instance

Now we have both target and source database endpoints to move further in the process as shown above

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.

Choose the source endpoint for your database in Azure VM ( for me, source azure) and your target endpoint that we have just created in Amazon RDS ( for me, “database-target”).

In the “Migration type” section; select the “Migrate existing data” to perform a one-time process to copy data from your source database to your target database. Use migration type one-time migrations. 

You can check more info:


Comments

Popular posts from this blog

How to Perform Penetration Testing on IoT Devices: Tools & Techniques for Business Security

The Internet of Things (IoT) has transformed our homes and workplaces but at what cost?   With billions of connected devices, hackers have more entry points than ever. IoT penetration testing is your best defense, uncovering vulnerabilities before cybercriminals do. But where do you start? Discover the top tools, techniques, and expert strategies to safeguard your IoT ecosystem. Don’t wait for a breach, stay one step ahead.   Read on to fortify your devices now!  Why IoT Penetration Testing is Critical  IoT devices often lack robust security by design. Many run on outdated firmware, use default credentials, or have unsecured communication channels. A single vulnerable device can expose an entire network.  Real-world examples of IoT vulnerabilities:   Mirai Botnet (2016) : Exploited default credentials in IP cameras and DVRs, launching massive DDoS attacks. Stuxnet (2010): Targeted industrial IoT systems, causing physical damage to nuclear centrifu...

Comparison between Mydumper, mysqldump, xtrabackup

Backing up databases is crucial for ensuring data integrity, disaster recovery preparedness, and business continuity. In MySQL environments, several tools are available, each with its strengths and optimal use cases. Understanding the differences between these tools helps you choose the right one based on your specific needs. Use Cases for Database Backup : Disaster Recovery : In the event of data loss due to hardware failure, human error, or malicious attacks, having a backup allows you to restore your database to a previous state.  Database Migration : When moving data between servers or upgrading MySQL versions, backups ensure that data can be safely transferred or rolled back if necessary.  Testing and Development : Backups are essential for creating realistic testing environments or restoring development databases to a known state.  Compliance and Auditing : Many industries require regular backups as part of compliance regulations to ensure data retention and integri...

Infrastructure-as-Prompt: How GenAI Is Revolutionizing Cloud Automation

Forget YAML sprawl and CLI incantations. The next frontier in cloud automation isn't about writing more code; it's about telling the cloud what you need. Welcome to the era of Infrastructure-as-Prompt (IaP), where Generative AI is transforming how we provision, manage, and optimize cloud resources. The Problem: IaC's Complexity Ceiling Infrastructure-as-Code (IaC) like Terraform, CloudFormation, or ARM templates revolutionized cloud ops. But it comes with baggage: Steep Learning Curve:  Mastering domain-specific languages and cloud provider nuances takes time. Boilerplate Bloat:  Simple tasks often require verbose, repetitive code. Error-Prone:  Manual coding leads to misconfigurations, security gaps, and drift. Maintenance Overhead:  Keeping templates updated across environments and providers is tedious. The Solution: GenAI as Your Cloud Co-Pilot GenAI models (like GPT-4, Claude, Gemini, or specialized cloud models) understand n...