1. Precautions
A DTS migration/synchronization process includes the following phases: precheck, structure synchronization, full data migration/synchronization, and incremental data migration/synchronization. To ensure that each phase runs smoothly, read the following usage notes before you create a migration task.
For information about the usage notes, see the precautions in Migrating Data from a Third-party Cloud PostgreSQL Database to an RDS PostgreSQL Database.
Note: The engine of an on-premises source database can only be PostgreSQL 12, and the engine version of the destination database must be equal to or later than that of the source database.
2. Procedure
Purchase a DTS Migration Instance
For information about how to purchase a DTS instance, see Purchasing a Data Migration Instance.
Configure your DTS instance based on the following description:
Select Data migration as the instance type, select Public EIP as the network type and select the purchased public EIP, specify PostgreSQL as the database type, and select an RDS PostgreSQL instance as the destination database instance.
Configure Task Information and Start a Task
After you purchase a DTS instance, go to the Configure page to configure your task.
Configure Source and Destination Databases
Configure the information about the source and destination databases, including the database type, IP addresses, ports, database accounts, and database passwords. Then, perform a connectivity test to check whether the source and destination databases can be connected.
Configure Objects to Be Migrated
After you configure the source and destination databases, click Test Connectivity and Proceed. Then, select the objects that you want to migrate.
Configuration description:
| Configuration | Description |
|---|---|
| Step | To perform only full data migration, select Struct Migration and Full Data Migration. To migrate data without service downtime, select Struct Migration, Full Data Migration, and Incremental Data Migration. Note: If Incremental Data Migration is not selected, to ensure data consistency, do not perform DML and DDL operations on the source database instance during data migration. |
| Migration Objects | You can migrate multiple types of objects from a source PostgreSQL database, including tables, views, functions, stored procedures, materialized views, rules, triggers, domains, and custom types. Select the objects that you want to migrate in the left-side multi-select box and click the > icon to move the objects to the right-side box. You can also click the < icon to remove an object from the right-side box. If you select the database-level object instead of some specific objects in the source database, DTS migrates the entire database. During subsequent incremental data migration, you can add new tables to the source database, and the newly added tables will also be migrated to the destination database. However, other types of newly added objects cannot be migrated during incremental migration. |
| Configuring name mapping | DTS supports database name mapping, table name mapping, and column name mapping. To change the name of an object in the destination instance, such as the destination database name or a table or column name, locate the object and click Edit. To change object names in the destination instance in a batch, click Batch Edit in the upper right corner of the right-side box. Note: If a migration task includes only structure migration and full data migration, you can configure column name mapping. If the task includes incremental data migration, you cannot configure column name mapping. The name of a database or table can be up to 64 characters in length and can only contain letters, digits, and underscores (_). If you migrate the entire database, you are not recommended to map database names or table names. |
| Filtering the data to be migrated | You can set a WHERE condition to filter data. The WHERE clause can contain single quotation marks (') and cannot contain semicolons (;) or two consecutive hyphens (--). DTS migrates only data that meets the WHERE condition to the destination database. |
| DML operations supported during incremental data migration | Configure DML operations for incremental data migration. 1. Select an object that you want to migrate. 2. Click Edit. 3. In the pop-up window, select the DML operations for incremental data migration. If you configure DML operations for both the database and table levels, the table-level settings overwrite the database-level settings. |
| DDL operations supported during incremental data migration | You can select whether to migrate incremental DDL statements during incremental data migration. Note: 1. If the task involves migrating an entire database, you must select Incremental DDL Statements. 2. In partial database migration, if Incremental DDL Statements is selected, DTS only migrates the DDL statements for objects that you want to migrate. 3. In partial database migration, if Incremental DDL Statements is not selected, DTS does not migrate DDL statements in the incremental data migration stage. How to implement incremental DDL migration: The source database captures DDL statements through event triggers and records the DDL statements in specific tables. Therefore, you must create event triggers and functions in the source database before data migration. For more information, see Prerequisites for DDL Operations for Synchronizing Incremental Data from a PostgreSQL Database. |
| Start Task as Scheduled | You can specify the start time of the task. By default, the migration task starts immediately after you click Start Task. |
Precheck and Start the Task
If the precheck is passed, click Start Migration to start the data migration task.
Task Management
For information about how to view migration progress, see Viewing Migration Progress.
For information about how to view a migration log, see Viewing a Migration Log.