Migrate Azure SQL single database to AWS RDS for SQL Server using AWS 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.
- Create Azure SQL single database instance.
- Create Amazon RDS for SQL Server database instance.
- Create AWS Data Migration Service (DMS) replication instance.
- Create database migration tasks.
- 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.
- Create Source endpoint
- Create Target endpoint
- 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.
- Server type: Database Engine
- Server name: <endpoint>,<port>
- Authentication: SQL Server Authentication
- Login: <Master username>
- Password: <Master password>
Create database migration tasks
AWS DMS provides 3 options for “Migration type”.
- Migrate existing data
- Migrate existing data and replicate ongoing changes
- 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.