This topic describes how to migrate full data from an Amazon RDS for SQL Server instance to an ApsaraDB RDS for SQL Server instance by using Data Transmission Service (DTS).
Prerequisites
- The Public accessibility option of the Amazon RDS for SQL Server instance is set to Yes. This ensures that DTS can access the Amazon RDS for SQL Server instance over the Internet.
- The database version of the Amazon RDS for SQL Server instance is 2005, 2008, 2008 R2, 2012, 2014, or 2016.
- An ApsaraDB RDS for SQL Server instance is created. For more information, see Create an ApsaraDB RDS for SQL Server instance.
- The available storage space of the ApsaraDB RDS for SQL Server instance is larger than the total size of the data in the Amazon RDS for SQL Server instance.
Precautions
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the loads of the database servers. If the database performance is unfavorable, the specification is low, or the data volume is large, database services may become unavailable. For example, DTS occupies a large amount of read and write resources in the following cases: a large number of slow SQL queries are performed on the source database, the tables have no primary keys, or a deadlock occurs in the destination database. Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours. For example, you can migrate data when the CPU utilization of the source and destination databases is less than 30%.
- Amazon RDS for SQL Server does not support incremental data migration because the sysadmin role is unavailable in Amazon RDS.
- The tables to be migrated in the source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
- If the name of the source database is invalid, you must create a database in the ApsaraDB
RDS for SQL Server instance before you configure a data migration task.
Note For more information about how to create a database and the database naming conventions, see Create an account and a database for an ApsaraDB RDS instance that runs SQL Server 2012, 2016, 2017 SE, or 2019 SE.
- If a data migration task fails, DTS automatically resumes the task. Before you switch your workloads to the destination instance, stop or release the data migration task. Otherwise, the data in the source instance will overwrite the data in the destination instance after the task is resumed.
Migration types
- Schema migration
DTS migrates the schemas of the required objects to the destination instance. DTS supports schema migration for the following types of objects: table, view, trigger, synonym, SQL stored procedure, SQL function, plan guide, user-defined type, rule, default, and sequence.
- Full data migration
DTS migrates historical data of the required objects from the Amazon RDS for SQL Server instance to the ApsaraDB RDS for SQL Server instance.Note DTS does not migrate data of the SQL_VARIANT type.
Billing
Migration type | Task configuration fee | Internet traffic fee |
---|---|---|
Schema migration and full data migration | Free of charge | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Pricing. |
Permissions required for database accounts
Database | Schema migration | Full data migration |
---|---|---|
Amazon RDS for SQL Server | The SELECT permission | The SELECT permission |
ApsaraDB RDS for SQL Server | The read and write permissions | The read and write permissions |
For more information about how to create and authorize a database account, see the following topics:
- Amazon RDS for SQL Server instance: CREATE USER
- ApsaraDB RDS for SQL Server instance: Create an account for an ApsaraDB RDS for SQL Server instance.
Process of full data migration
To prevent data migration failures caused by dependencies among objects, DTS migrates the schemas and data of the source SQL Server database in the following order:
- Migrate the schemas of tables, views, synonyms, user-defined types, rules, defaults, and plan guides.
- Perform full data migration.
- Migrate the schemas of SQL stored procedures, SQL functions, triggers, and foreign keys.