![DMS Cooks It Up: Azure SQL DB to RDS SQL Server Migration](https://assets.community.aws/a/2hRIZIw270KLzMITE8QgOiKHkyQ/Migr.webp)
DMS Cooks It Up: Azure SQL DB to RDS SQL Server Migration
Migrating Azure SQL Database to Amazon RDS for SQL Server using AWS DMS
Published Jun 5, 2024
Last Modified Jul 28, 2024
According to research and customer testimonials, Microsoft SQL Server has a lot of benefits in AWS in terms of price, performance, and high availability. Suspicious? This is definitely not a cap. Here are some facts to check out:
- https://aws.amazon.com/blogs/compute/sql-server-runs-better-on-aws/
- https://aws.amazon.com/blogs/compute/we-love-sql-server-running-on-aws-almost-as-much-as-our-customers/
- https://aws.amazon.com/blogs/compute/learn-why-aws-is-the-best-cloud-to-run-microsoft-windows-server-and-sql-server-workloads/
If you're already convinced, the best time to migrate was yesterday! With AWS, migrating is easy and worry-free. In this article, I'll show you how simple it is to migrate your Azure SQL Database to Amazon RDS for SQL Server using AWS DMS. Let's get cooking!
AWS DMS is a helpful tool for moving your databases (relational databases, data warehouses, and even NoSQL databases) to the cloud. Whether you want to migrate your data entirely to the AWS Cloud or move it between cloud and on-premises locations, AWS DMS can assist you. This service can discover your source data stores, convert your source schemas, and migrate your data.
You can read more here: https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html
Amazon RDS simplifies cloud database management for a variety of engine choices, including popular open-source options like MySQL, MariaDB, PostgreSQL, and Aurora (MySQL-compatible and PostgreSQL-compatible editions), as well as commercial choices like SQL Server, Oracle, and Db2. It offers easy setup, operation, and scaling for these engines, along with cost-effective, adjustable storage, and handles routine database admin tasks for you.
You can read more here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html
Azure SQL Database is always running on the latest stable version of the SQL Server database engine and patched OS withΒ 99.99% availability. PaaS capabilities built into Azure SQL Database enable you to focus on the domain-specific database administration and optimization activities that are critical for your business.
You can read more here: https://learn.microsoft.com/en-us/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview?view=azuresql
- Complete setup of Azure Network Environment (Virtual Network)
- Complete setup of AWS Network Environment (Virtual Private Cloud)
- Site-to-Site connection setup to connect the Azure environment and AWS environment. Refer to my blog post: https://community.aws/content/2j5iQAHKfnVjDEhtVIkfv4nqH0G
- Setup Azure SQL Database.
![](https://assets.community.aws/a/2hJGd1UNeegwQrRTZ2ped0CPFWF/Azur.webp)
- Make sure that your database has data. In here, I've chosen the sample database (AdventureWorks) provided by Azure SQL Database upon the creation of the instance.
![](https://assets.community.aws/a/2hJGm3j9j8adlggQgTwYlPcrxqx/Azur.webp)
![](https://assets.community.aws/a/2hJGvXlcDLtpH3TYkKZrlLcH4C9/Azur.webp)
- We want the database to be privately accessed (via VPN) so we need to disable the public network access.
![](https://assets.community.aws/a/2hJHHLgd9lU4gSIs0cwrzzqMbaT/Azur.webp)
- Create a private endpoint to ensure private access. Make sure to copy its Private IP address because we will use it later.
![](https://assets.community.aws/a/2hJHWm9VMga6PUAK940yFCsp2A1/Azur.webp)
- Create a private Amazon RDS for SQL Server.
![](https://assets.community.aws/a/2hJHqrDuSD5kcs91ylsvp9byQPd/Amaz.webp)
- Create a private replication instance in AWS DMS.
![](https://assets.community.aws/a/2hJI791Qs9EqPMTLtZyZtIynmF4/AWS-.webp)
- Create an Amazon Route 53 Hosted Zone and create an A record for the Azure private endpoint that we created earlier so that AWS can reach the Azure SQL Database. This is the time that you will use the Private IP that you copied earlier.
![](https://assets.community.aws/a/2hJIJPFDYuHUCkq2t4gmW0L8BGR/Amaz.webp)
- Create the source and target endpoints and ensure that they have successful connections.
![](https://assets.community.aws/a/2hJIchbapLoCG9k2ENpg0OyDIfw/AWS-.webp)
![](https://assets.community.aws/a/2hJIfHVEYzrdZSVWXY2qUuLtUB6/AWS-.webp)
- Create a AWS DMS Migration Task (Full Load only since as of this writing, Azure SQL Database doesnβt support Ongoing Replication)
![](https://assets.community.aws/a/2hJInoCe3bUUU2xkwyOgJOw5ST4/AWS-.webp)
- Check your Amazon RDS for SQL Server if the data migrated successfully.
![](https://assets.community.aws/a/2hJIu1hhwPezdJHqzvuYoF5X4WO/Amaz.webp)
Errors are inevitable, but they can be valuable learning experiences. Here are a few things I've learned from my own troubleshooting:
- Have a successful Site-to-Site VPN connection. To verify the connection between your cloud environments, create temporary virtual machines in each environment. Ensure your firewall rules allow ICMP (ping) traffic on both sides to facilitate testing. Once the VMs are running, use the "ping" command from one VM to the IP address of the other VM to test connectivity.
- To ensure secure communication and successful connection within and between cloud environments, implement necessary inbound and outbound firewall rules for all database instances, replication instances, and other workloads. Specifically, allow inbound traffic on ports commonly used by database services like 1433 for Microsoft SQL Server. These rules should be configured following the principle of least privilege, granting access only to authorized sources and services.
- To securely connect your AWS resources to your Azure SQL Database, leverage an Amazon Route 53 Private Hosted Zone. This acts as a private DNS service within your AWS Virtual Private Cloud (VPC). You can create a DNS record that points to your Azure SQL Database private endpoint without exposing its IP to the public internet.
- The database user that you stated in the source endpoint must have the necessary permissions to perform the migration. To know the necessary permissions, check this AWS documentation: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.SQLServer.html
I'm an AWS Cloud Engineer at Computrade Technology Philippines, Inc., an AWS Partner. We specialize in all aspects of AWS Cloud, particularly databases. Whether you're migrating workloads, optimizing costs, enhancing security, or building chatbots, our expert AWS Cloud Engineers are here to help.
Reach us out via:
- Email: ctp_sales@computradetech.com.ph
- Website: computradetech.com.ph
Β