AWS Database Migration Service User Guide
Start a Database Migration
Getting Started
AWS Database Migration Service (AWS DMS) helps you migrate databases to AWS easily and securely.
You can migrate your data to and from most widely used commercial and open-source databases, such as Oracle, MySQL, and PostgreSQL. The service supports homogeneous migrations such as Oracle to
Oracle, and also heterogeneous migrations between different database platforms, such as Oracle to
PostgreSQL or MySQL to Oracle.
For information on the cost of database migration using AWS Database Migration Service, see the AWS
Database Migration Service pricing page .
Topics
•
Start a Database Migration with AWS Database Migration Service (p. 24)
•
Step 1: Welcome (p. 25)
•
Step 2: Create a Replication Instance (p. 25)
•
Step 3: Specify Database Endpoints (p. 28)
•
Step 4: Create a Task (p. 32)
•
Monitor Your Task (p. 35)
Start a Database Migration with AWS Database
Migration Service
There are several ways to begin a database migration. You can select the AWS DMS console wizard that will walk you through each step of the process, or you can do each step by selecting the appropriate task from the navigation pane. You can also use the AWS CLI; for information on using the CLI with AWS DMS, see DMS .
To use the wizard, select Getting started for from the navigation pane on the AWS DMS console. You can use the wizard to help create your first data migration. Following the wizard process, you allocate a replication instance that performs all the processes for the migration, specify a source and a target database, and then create a task or set of tasks to define what tables and replication processes you want to use. AWS DMS then creates your replication instance and performs the tasks on the data being migrated.
API Version API Version 2016-01-01
24
AWS Database Migration Service User Guide
Step 1: Welcome
Alternatively, you can create each of the components of an AWS DMS database migration by selecting the items from the navigation pane. For a database migration, you must do the following:
• Complete the tasks outlined in
Setting Up (p. 20)
• Allocate a replication instance that performs all the processes for the migration
• Specify a source and a target database endpoint
• Create a task or set of tasks to define what tables and replication processes you want to use
Step 1: Welcome
If you start your database migration using the AWS DMS console wizard, you will see the Welcome page, which explains the process of database migration using AWS DMS.
To start a database migration from the console's Welcome page
• Choose Next.
Step 2: Create a Replication Instance
Your first task in migrating a database is to create a replication instance that has sufficient storage and processing power to perform the tasks you assign and migrate data from your source database to the target database. The required size of this instance varies depending on the amount of data you need to migrate and the tasks that you need the instance to perform. For more information about replication instances, see
Replication Instances for AWS Database Migration Service (p. 7)
.
API Version API Version 2016-01-01
25
AWS Database Migration Service User Guide
Step 2: Create a Replication Instance
The procedure following assumes that you have chosen the AWS DMS console wizard. Note that you can also do this step by selecting Replication instances from the AWS DMS console's navigation pane and then selecting Create replication instance.
To create a replication instance by using the AWS console
1. On the Create replication instance page, specify your replication instance information. The following table describes the settings.
For This Option
Name
Description
Instance class
VPC
Do This
Type a name for the replication instance that contains from 8 to 16 printable ASCII characters (excluding /,", and @). The name should be unique for your account for the region you selected. You can choose to add some intelligence to the name, such as including the region and task you are performing, for example
west2mysql2mysql-instance1
.
Type a brief description of the replication instance.
Choose an instance class with the configuration you need for your migration. Keep in mind that the instance must have enough storage, network, and processing power to successfully complete your migration. For more information on how to determine which instance class is best for your migration, see
Replication Instances for AWS
Database Migration Service (p. 7) .
Choose the Amazon Virtual Private Cloud (Amazon VPC) you want to use. If your source or your target database is in an VPC, choose that VPC. If your source and your target databases are in different VPCs, ensure that they are both in public subnets and are publicly accessible,
API Version API Version 2016-01-01
26
AWS Database Migration Service User Guide
Step 2: Create a Replication Instance
For This Option
Multi-AZ
Do This
and then choose the VPC where the replication instance is to be located. The replication instance must be able to access the data in the source VPC. If neither your source nor your target database is in a VPC, select a VPC where the replication instance is to be located.
Use this optional parameter to create a standby replica of your replication instance in another Availability Zone for failover support. If you intend to use change data capture (CDC) or ongoing replication, you should enable this option.
Publicly accessible
Choose this option if you want the replication instance to be accessible from the Internet.
2. Choose the Advanced tab, shown following, to set values for network and encryption settings if you need them.
3. Specify the additional settings. The following table describes the settings.
For This Option
Allocated storage (GB)
Do This
Storage is primarily consumed by log files and cached transactions. For caches transactions, storage is used only
API Version API Version 2016-01-01
27
AWS Database Migration Service User Guide
Step 3: Specify Database Endpoints
For This Option
Replication Subnet Group
Availability zone
VPC Security group(s)
KMS master key
Do This
when the cached transactions need to be written to disk.
Therefore, AWS DMS doesn’t use a significant amount of storage.Some exceptions include the following:
• Very large tables that incur a significant transaction load. Loading a large table can take some time, so cached transactions are more likely to be written to disk during a large table load.
• Tasks that are configured to pause prior to loading cached transactions. In this case, all transactions are cached until the full load completes for all tables. With this configuration, a fair amount of storage might be consumed by cached transactions.
• Tasks configured with tables being loaded into Amazon
Redshift. However, this configuration isn't an issue when Aurora is the target.
In most cases, the default allocation of storage is sufficient. However, it’s always a good idea to pay attention to storage related metrics and scale up your storage if you find you are consuming more than the default allocation.
Choose the replication subnet group in your selected VPC where you want the replication instance to be created.
If your source database is in a VPC, choose the subnet group that contains the source database as the location for your replication instance. For more information about replication subnet groups, see
Creating a Replication
Subnet Group (p. 12)
.
Choose the Availability Zone where your source database is located.
The replication instance is created in a VPC. If your source database is in a VPC, select the VPC security group that provides access to the DB instance where the database resides.
Choose the encryption key to use to encrypt replication storage and connection information. If you choose
(Default) aws/dms, the default AWS Key Management
Service (AWS KMS) key associated with your account and region is used. For more information on using the encryption key, see
Setting an Encryption Key and
Specifying KMS Permissions (p. 54) .
4. Choose Next.
Step 3: Specify Database Endpoints
While your replication instance is being created, you can specify the source and target databases. The source and target databases can be on an Amazon Elastic Compute Cloud (Amazon EC2) instance, an
Amazon Relational Database Service (Amazon RDS) DB instance, or an on-premises database.
API Version API Version 2016-01-01
28
AWS Database Migration Service User Guide
Step 3: Specify Database Endpoints
The procedure following assumes that you have chosen the AWS DMS console wizard. Note that you can also do this step by selecting Endpoints from the AWS DMS console's navigation pane and then selecting
Create endpoint. When using the console wizard, you create both the source and target endpoints on the same page. When not using the console wizard, you create each endpoint separately.
To specify source or target database endpoints using the AWS console
1. On the Connect source and target database endpoints page, specify your connection information for the source or target database. The following table describes the settings.
API Version API Version 2016-01-01
29
AWS Database Migration Service User Guide
Step 3: Specify Database Endpoints
For This Option
Endpoint identifier
Source engine and Target engine
Server name
Do This
Type the name you want to use to identify the endpoint.
You might want to include in the name the type of endpoint, such as
oracle-source
or
PostgreSQL-target
.
The name must be unique for all replication instances.
Choose the type of database engine that is the endpoint.
Type the server name. For an on-premises database, this can be the IP address or the public hostname.
For an Amazon RDS DB instance, this can be the endpoint (also called the DNS name) for the DB instance, such as
mysqlsrvinst.abcd12345678.uswest-2.rds.amazonaws.com
.
Type the port used by the database.
Port
SSL mode
User name
Choose an SSL mode if you want to enable connection encryption for this endpoint. Depending on the mode you select, you might be asked to provide certificate and server certificate information.
Type the user name with the permissions required to allow data migration. For information on the permissions required, see the security section for the source or target database engine in this user guide.
Password
Type the password for the account with the required permissions. If you want to use special characters in your password, such as "+" or "&", enclose the entire password in curly braces "{}".
2. Choose the Advanced tab, shown following, to set values for connection string and encryption key if you need them. You can test the endpoint connection by choosing Run test.
API Version API Version 2016-01-01
30
AWS Database Migration Service User Guide
Step 3: Specify Database Endpoints
For This Option
Extra connection attributes
KMS master key
Do This
Type any additional connection parameters here. For more information about extra connection attributes, see
Using Extra Connection Attributes with AWS Database
Migration Service (p. 197)
.
Choose the encryption key to use to encrypt replication storage and connection information. If you choose
(Default) aws/dms, the default AWS Key Management
Service (AWS KMS) key associated with your account and region is used. For more information on using the encryption key, see
Setting an Encryption Key and
Specifying KMS Permissions (p. 54) .
API Version API Version 2016-01-01
31
AWS Database Migration Service User Guide
Step 4: Create a Task
Step 4: Create a Task
Create a task to specify what tables to migrate, to map data using a target schema, and to create new tables on the target database. As part of creating a task, you can choose the type of migration: to migrate existing data, migrate existing data and replicate ongoing changes, or replicate data changes only.
Using AWS DMS, you can specify precise mapping of your data between the source and the target database. Before you specify your mapping, make sure you review the documentation section on data type mapping for your source and your target database.
You can choose to start a task as soon as you finish specifying information for that task on the
Create task page, or you can start the task from the Dashboard page once you finish specifying task information.
The procedure following assumes that you have chosen the AWS DMS console wizard and specified replication instance information and endpoints using the console wizard. Note that you can also do this step by selecting Tasks from the AWS DMS console's navigation pane and then selecting Create task.
To create a migration task
1. On the Create Task page, specify the task options. The following table describes the settings.
For This Option
Task name
Do This
Type a name for the task.
API Version API Version 2016-01-01
32
AWS Database Migration Service User Guide
Step 4: Create a Task
For This Option
Task description
Source endpoint
Target endpoint
Do This
Type a description for the task.
Shows the source endpoint that will be used.
Shows the target endpoint that will be used.
Replication instance
Migration type
Start task on create
Shows the replication instance that will be used.
Choose the migration method you want to use. You can choose to have just the existing data migrated to the target database or have ongoing changes sent to the target database in addition to the migrated data.
When this option is selected, the task begins as soon as it is created.
2. Choose the Task Settings tab, shown following, and specify values for your target table, LOB support, and to enable logging. The task settings shown depend on the Migration type value you select. For example, when you select Migrate existing data, the following options are shown:
For This Option
Target table preparation mode
Include LOB columns in replication
Do This
Do nothing - Data and metadata of the target tables are not changed.
Drop tables on target - The tables are dropped and new tables are created in their place.
Truncate - Tables are truncated without affecting table metadata.
Don't include LOB columns - LOB columns will be excluded from the migration.
Full LOB mode - Migrate complete LOBs regardless of size. LOBs are migrated piecewise in chunks controlled by the LOB chunk size. This method is slower than using
Limited LOB Mode.
API Version API Version 2016-01-01
33
AWS Database Migration Service User Guide
Step 4: Create a Task
For This Option
Max LOB size (kb)
Do This
Limited LOB mode - Truncate LOBs to ‘Max LOB Size’
This method is faster than using Full LOB Mode.
For more information about LOB support in AWS DMS, see
LOB Support for Source Databases (p. 18)
In Limited LOB Mode, LOB columns which exceed the setting of Max LOB Size will be truncated to the specified
Max LOB Size.
Enables logging by Amazon CloudWatch.
Enable logging
When you select Migrate existing data and replicate for Migration type, the following options are shown:
For This Option
Target table preparation mode
Do This
Do nothing - Data and metadata of the target tables are not changed.
Drop tables on target - The tables are dropped and new tables are created in their place.
Truncate - Tables are truncated without affecting table metadata.
API Version API Version 2016-01-01
34
AWS Database Migration Service User Guide
Monitor Your Task
For This Option
Stop task after full load completes
Include LOB columns in replication
Do This
Don't stop - Do not stop the task, immediately apply cached changes and continue on.
Stop before applying cached changes - Stop the task prior to the application of cached changes. This will allow you to add secondary indexes which may speed the application of changes.
Stop after applying cached changes - Stop the task after cached changes have been applied. This will allow you to add foreign keys, triggers etc. if you are using
Transactional Apply.
Don't include LOB columns - LOB columns will be excluded from the migration.
Full LOB mode - Migrate complete LOBs regardless of size. LOBs are migrated piecewise in chunks controlled by the LOB chunk size. This method is slower than using
Limited LOB Mode.
Limited LOB mode - Truncate LOBs to ‘Max LOB Size’
This method is faster than using Full LOB Mode.
Max LOB size (kb)
In Limited LOB Mode, LOB columns which exceed the setting of Max LOB Size will be truncated to the specified
Max LOB Size.
Enables logging by Amazon CloudWatch.
Enable logging
3. Choose the Table mappings tab, shown following, to set values for schema mapping and the mapping method. If you choose Custom, you can specify the target schema and table values. For more information about table mapping, see
Using Table Mapping with an Task to Select and Filter
Data (p. 133) .
4. Once you have finished with the task settings, choose Create task.
Monitor Your Task
If you select Start task on create when you create a task, your task begins immediately to migrate your data when you choose Create task. You can view statistics and monitoring information for your task
API Version API Version 2016-01-01
35
AWS Database Migration Service User Guide
Monitor Your Task by choosing the running task from the AWS Management Console. The following screenshot shows the
table statistics of a database migration. For more information about monitoring, see Monitoring AWS
Database Migration Service Tasks (p. 148)
API Version API Version 2016-01-01
36