Database Migration - Database Migration Guide
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Database Migration

This section covers two major database migration tasks: code conversion and data load. You can use Amazon Schema Conversion Tool (Amazon SCT) to convert database schema objects such as tables, views, procedures, functions, and so on. Then you can use Amazon Database Migration Service (Amazon DMS) to load data.

Database Schema Conversion

To convert your database schema and code objects from SAP ASE to Amazon Aurora MySQL, follow these steps.

  1. Download and install Amazon Schema Conversion Tool (Amazon SCT) with the required SAP ASW and MySQL JDBC drivers. For more information, see https://docs.aws.amazon.com/SchemaConversionTool/latest/userguide/CHAP_Installing.html.

  2. Create a new Amazon SCT project, add your source and target databases, and add a mapping rule. For more information, see Creating a new project, Adding database servers, and Creating mapping rules.

  3. Convert your database schema. For more information, see Converting database schemas.

  4. Save the converted SQL scripts. For more information, see Saving and applying your converted schema.

  5. Run these scripts against your target MySQL database. First, create tables with primary keys only. Then add the foreign keys and secondary indexes after you complete the full load.

Migrate an SAP ASE Database to Amazon Aurora MySQL Using Amazon DMS

This section covers the steps that you follow to migrate an SAP ASE database to Amazon Aurora MySQL using Amazon DMS.

Amazon DMS creates the schema in the target if the schema doesn’t exist. However, Amazon DMS only creates the tables with primary keys. Amazon DMS doesn’t create foreign keys or secondary indexes. Even the default values may be missing.

The best practice is to create the schema objects using the scripts that Amazon SCT generated in the prior step, then start Amazon DMS to load table data.

Create a Replication Instance

To start data migration, create an Amazon DMS replication instance. For performance reasons, Amazon DMS recommends creating the replication instance in the same Amazon Region as your target Amazon Aurora database. For more information, see Creating a replication instance.

Create a Source Endpoint

Create a source endpoint for SAP ASE and test the connection using the preceding replication instance.

  • On the Amazon DMS console, choose Endpoints.

  • Choose Create endpoint.

  • For Endpoint type, select Source endpoint.

  • Enter your desired endpoint configuration.

    
                        Source endpoint configuration

    You can use your own on-premises name server and a hostname instead of the IP address. For more information, see Using your own on-premises name server.

  • Select the endpoint that you created, and choose Test connection from the Actions drop-down menu.

To use Transport Layer Security (TLS) for an SAP ASE database version 15.7 and higher, use the Adaptive Server Enterprise 16.03.06 extra connection attribute (ECA) provider. Use the following example:

provider=Adaptive Server Enterprise 16.03.06;

Make sure that you open the database port to the IP range of your replication instance before you test the connection. If the firewall is open but you still experience a connection issue, please contact Amazon support.

Create a Target Endpoint

Create a target endpoint for your Amazon Aurora MySQL database.

  • On the Amazon DMS console, choose Endpoints.

  • Choose Create endpoint.

  • For Endpoint type, select Target endpoint.

  • Enter your desired endpoint configuration.

    
                        Target endpoint configuration
  • Test the connection using the preceding replication instance.

To establish the connection, make sure that you edit the security group for your Amazon Aurora DB instance. Also, open the 3306 port on your MySQL database to the private IP or IP range of the replication instance.

  • On the Amazon Relational Database Service (Amazon RDS) console, choose your Amazon Aurora MySQL DB instance.

  • On the Connectivity & security tab, locate your security group name under Security.

  • Choose the security group link. A new security group interface page opens.

  • Choose Inbound rules.

  • Choose Edit inbound rules.

  • Add the IP range of the replication instance.

Create a Migration Task

Create a migration task using the source and target endpoints that you created on the preceding step. For more information, see Creating a task. After you create your task, Amazon DMS sets its status to Ready. When you start or resume the task, Amazon DMS changes the status to Starting or Running.

To monitor the process, choose Task Monitoring, Table Statistics, Logs. For more information, see Monitoring Database Migration Service metrics and How can I enable monitoring for an database migration task?.

Cutover Procedures

When the Amazon DMS task finishes the full load and applies cached changes, the task moves to the change data capture (CDC) stage. At this point, you can perform the cutover to Amazon Aurora. You run SQL queries to validate data and use Amazon services to set up backup and monitor jobs.

To perform the cutover, do the following:

  • Analyze the database queries in Amazon Aurora MySQL and test the performance of critical queries.

  • Shut down all the application servers and stop all the client connections to SAP ASE. Close any user sessions if necessary.

  • Verify that the target data has been synced with the source database.

  • Stop the Amazon DMS task.

  • Create the foreign keys and secondary indexes in Amazon Aurora MySQL if you didn’t create them before the CDC stage started.

  • Validate tables, views, procedures, functions, and triggers within your schema.

  • Switch the application servers, clients, and jobs to the Amazon Aurora MySQL database.

  • Create the CloudWatch alarms based on your desired DB metrics. For more information, see Key Metrics for Amazon Aurora and Monitoring an Amazon Aurora DB Cluster.

  • Add a reader node to an existing Amazon Aurora MySQL cluster. By default, Amazon Aurora replicates data across three Availability Zones in one Region at the storage level. This architecture is fault tolerant by design. For enhanced availability, add a reader node for a production database to automate failover in case of instance failure. Modify the database cluster to enable failover in case of instance failure. For more information, see High Availability for Amazon Aurora.

Troubleshooting

For more information about troubleshooting issues with Amazon DMS, see Troubleshooting migration tasks in Database Migration Service.

For more information about troubleshooting issues specific to using Amazon DMS with SAP ASE databases, see Troubleshooting issues with SAP ASE.

For more information about troubleshooting issues specific to using Amazon DMS with Amazon Aurora MySQL databases, see Troubleshooting issues with MySQL and Troubleshooting issues with Amazon Aurora MySQL.