Migrate Azure SQL single database to AWS RDS for SQL Server using AWS DMS

In my earlier blog post, I explained the process to migrate a database from AWS RDS to Azure SQL using Azure DMS.

In this blog post, you shall see the process involved in migrating a database from Azure SQL to AWS RDS for SQL Server using AWS DMS.

The process involves these steps.

  1. Create Azure SQL single database instance.
  2. Create Amazon RDS for SQL Server database instance.
  3. Create AWS Data Migration Service (DMS) replication instance.
  4. Create database migration tasks.
  5. Perform database migration from Azure SQL to Amazon RDS for SQL Server using AWS DMS.

AWS provides a tool called Schema Conversion Tool, for converting the schema from one database engine to another. This is not needed for my use case as both source and target are on same database engine (SQL Server).

This tool very helpful for use case like source on Azure SQL or SQL Server and the target is on MySQL or PostgreSQL on AWS.

Step 1: Create Azure SQL single database instance

I chose to use existing data from AdventureWorksLT sample database in my Azure SQL database.

Step 2: Create Amazon RDS for SQL Server database instance

I chose to go with “Easy Create” database creation method as it saves time in the creation process. Some of the default settings applied during database creation can be modified later.

As this instance is only for testing purposes, I just went with the username as “admin”. This is not recommended for actual workloads.

Step 3: Create AWS Data Migration Service (DMS) replication instance

DMS replication instance’s performance depends on the “Instance class”. This has to be chosen carefully based on the source workload.

Step 4: Create database migration tasks

These are the steps involved in creating database migration tasks.

  1. Create Source endpoint
  2. Create Target endpoint
  3. Create database migration tasks

Create Source endpoint

Note: Before creating the endpoint for Azure SQL instance, a new firewall rule has to be added to Azure SQL server to allow the access from AWS DMS replication instance’s Public IP address.

Create Target endpoint

I created an empty database “azsql” in the instance, by logging into the instance using SSMS. These details must be entered in SSMS to connect to the Amazon RDS for SQL Server database instance.

  1. Server type: Database Engine
  2. Server name: <endpoint>,<port>
  3. Authentication: SQL Server Authentication
  4. Login: <Master username>
  5. Password: <Master password>

Create database migration tasks

AWS DMS provides 3 options for “Migration type”.

  1. Migrate existing data
  2. Migrate existing data and replicate ongoing changes
  3. Replicate data changes only

For my use case, “Migrate existing data” migration type is suitable as this is a test use case.

For Target table preparation mode, I chose “Do Nothing”. For this option, AWS DMS creates new tables if none exist. This option is suitable to my use case as I have only created an empty database in the target database instance.

Enable validation” is very helpful in making sure the data is copied properly to the target database.

Premigration assessment is very helpful for actual database migration use cases. A premigration assessment warns you of potential migration issues before starting your database migration task.

Step 5: Perform database migration from Azure SQL to Amazon RDS for SQL Server using AWS DMS

Database migration process starts automatically once the migration task is created.

Disclaimer: The posts here represent my personal views and not those of my employer or any specific vendor. Any technical advice or instructions are based on my own personal knowledge and experience.

--

--