Step 4: Use AWS SCT to Convert the SQL Server Schema to Aurora MySQL
Before you migrate data to Amazon Aurora MySQL, convert the Microsoft SQL Server schema to an Aurora MySQL schema using the AWS Schema Conversion Tool (AWS SCT). This video covers all the steps of this process
To convert a SQL Server schema to an Aurora MySQL schema, do the following:
-
Launch AWS SCT. In AWS SCT, choose File, then choose New Project. Create a new project named
AWS Schema Conversion Tool SQL Server to Aurora MySQL
, specify the Location of the project folder, and then choose OK. -
Choose Add source to add a source Microsoft SQL Server database to your project, then choose Microsoft SQL Server, and choose Next.
-
Enter the following information, and then choose Test connection.
Parameter Description Connection name
Enter
Microsoft SQL Server
. AWS SCT displays this name in the tree in the left panel.Server name
Enter the server name.
Server port
Enter the SQL Server port number. The default is
1433
.Instance name
Enter the SQL Server database instance name.
User name
Enter the SQL Server admin user name.
Password
Enter the password for the admin user.
-
Choose OK to close the alert box. Then choose Connect to close the dialog box and connect to the Microsoft SQL Server database instance. AWS SCT displays the structure of the Microsoft SQL Server database instance in the left panel.
-
Choose Add target to add a target Amazon Aurora MySQL database to your project, then choose Amazon Aurora (MySQL compatible), and choose Next.
-
Enter the following information and then choose Test Connection.
Parameter Description Connection name
Enter
Aurora MySQL
. AWS SCT displays this name in the tree in the right panel.Server name
Enter the server name.
Server port
Enter the SQL Server port number. The default is
3306
.User name
Enter the Aurora MySQL admin user name.
Password
Enter the password for the admin user.
-
Choose OK to close the alert box. Then choose Connect to close the dialog box and connect to the Aurora MySQL database instance.
-
In the tree in the left panel, select the schema to migrate. In the tree in the right panel, select your target Aurora MySQL database. Choose Create mapping.
-
Choose Main view. In the tree in the left panel, right-click the HR schema and choose Create report.
-
Open the context (right-click) menu for the schema to migrate, and then choose Convert schema.
-
Choose Yes for the confirmation message. AWS SCT analyzes the schema, creates a database migration assessment report, and converts your schema to the target database format.
-
Choose Assessment Report View from the menu to check the database migration assessment report. The report breaks down by each object type and by how much manual change is needed to convert it successfully.
Generally, packages, procedures, and functions are more likely to have some issues to resolve because they contain the most custom Transact-SQL code. AWS SCT also provides hints about how to fix these objects.
-
Choose the Action Items tab.
The Action Items tab shows each issue for each object that requires attention.
For each conversion issue, you can complete one of the following actions:
-
Modify the objects on the source SQL Server database so that AWS SCT can convert the objects to the target Aurora MySQL database.
-
Modify the objects on the source SQL Server database.
-
Repeat the previous steps to convert the schema and check the assessment report.
-
If necessary, repeat this process until there are no conversion issues.
-
Choose Main View from the menu. Open the context (right-click) menu for the target Aurora MySQL schema, and choose Apply to database to apply the schema changes to the Aurora MySQL database, and confirm that you want to apply the schema changes.
-
-
Instead of modifying the source schema, modify scripts that AWS SCT generates before applying the scripts on the target Aurora MySQL database.
-
Choose Main View from the menu. Open the context (right-click) menu for the target Aurora MySQL schema name, and choose Save as SQL. Next, choose a name and destination for the script.
-
In the script, modify the objects to correct conversion issues.
You can also exclude foreign key constraints, triggers, and secondary indexes from the script because they can cause problems during the migration. After the migration is complete, you can create these objects on the Aurora MySQL database.
-
Run the script on the target Aurora MySQL database.
-
For more information, see Converting Database Schema to Amazon RDS.
-
-
(Optional) Use AWS SCT to create migration rules.
-
Choose Mapping view and then choose New migration rule.
-
Create additional migration transformation rules that are required based on the action items.
-
Save the migration rules.
-
Choose Export script for DMS to export a JSON format of all the transformations that the AWS DMS task will use. Choose Save.
-