__tencentdb__ in the source database. This database records data comparison information during the migration task.__tencentdb__ system database in the source database is not deleted after the migration task is completed.__tencentdb__ system database occupies minimal space, approximately 0.01% to 0.1% of the source database's storage capacity. For example, for a 50 GB source database, the __tencentdb__ system database is approximately 5 MB–50 MB. It employs a single-threaded, connection-waiting mechanism, thus having a negligible impact on source database performance and not preempting any resources.CREATE USER 'migration_account'@'%' IDENTIFIED BY 'migration_password';GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT, REPLICATION SLAVE, SHOW DATABASES, SHOW VIEW, PROCESS ON *.* TO 'migration_account'@'%';// If the source is a TencentDB for MariaDB database, you must submit a ticket to request RELOAD permissions. For other scenarios, refer to the code for authorization.// When the source database is an Alibaba Cloud database, you do not need to grant SHOW DATABASES permissions. For other scenarios, you must grant the permissions. For Alibaba Cloud database authorization, see https://help.aliyun.com/document_detail/96101.html.// If you choose to migrate triggers and events, you must also grant TRIGGER and EVENT permissions.GRANT ALL PRIVILEGES ON `__tencentdb__`.* TO 'migration_account'@'%';GRANT SELECT ON *.* TO 'migration_account';
CREATE USER 'migration_account'@'%' IDENTIFIED BY 'migration_password';GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT, REPLICATION SLAVE, SHOW DATABASES, SHOW VIEW, PROCESS ON *.* TO 'migration_account'@'%';// If the source is a TencentDB for MariaDB database, you must submit a ticket to request RELOAD permissions. For other scenarios, refer to the code for authorization.// When the source database is an Alibaba Cloud database, you do not need to grant SHOW DATABASES permissions. For other scenarios, you must grant the permissions. For Alibaba Cloud database authorization, see https://help.aliyun.com/document_detail/96101.html.// If you choose to migrate triggers and events, you must also grant TRIGGER and EVENT permissions.GRANT ALL PRIVILEGES ON `__tencentdb__`.* TO 'migration_account'@'%';GRANT SELECT ON `mysql`.* TO 'migration_account'@'%';GRANT SELECT ON `database_to_be_migrated`.* TO 'migration_account';
information_schema, sys, performance_schema, __cdb_recycle_bin__, __recycle_bin__, __tencentdb__, and mysql.DEFINER ([DEFINER = user1]) in the source database matches the migration account user2. If they do not match, after migration, DTS modifies the SQL SECURITY attribute of user1 in the target database, changing it from DEFINER to INVOKER ([INVOKER = user1]). At the same time, DTS sets the DEFINER in the target database to the migration account user2 ([DEFINER = migration account user2]). If the view definition in the source database is overly complex, it may cause the task to fail.STATEMENT format, the migration will fail.lower_case_table_names parameter (case sensitivity for table names) to be consistent between the source and target databases. If the source database is TencentDB for MariaDB, note that the lower_case_table_names parameter for TencentDB for MariaDB can only be modified during instance creation. Therefore, you must determine the case sensitivity rule when creating the source database instance. If the parameter validation fails, modify the lower_case_table_names parameter of the target database.ALTER VIEW statement is not supported. If this statement is encountered, it is skipped and not migrated.STATEMENT Binlog format to the source database.__tencentdb__.Operation Type | Supported SQL Operations |
DML | INSERT,UPDATE,DELETE,REPLACE |
DDL | TABLE:CREATE TABLE,ALTER TABLE,DROP TABLE,TRUNCATE TABLE,RENAME TABLE VIEW:CREATE VIEW,DROP VIEW INDEX:CREATE INDEX,DROP INDEX DATABASE:CREATE DATABASE,ALTER DATABASE,DROP DATABASE Currently, statements such as CREATE TABLE table_name AS SELECT are not supported. |
Type | Environment Requirement |
Source database requirements | The networks between the source and target databases can be connected. The server where the source database is located is required to have sufficient outbound bandwidth; otherwise, the migration speed is affected. Instance parameter requirements: The server_id parameter of the source database needs to be manually set and cannot be set to 0. The row_format of source database tables cannot be set to FIXED. The lower_case_table_names variable must be set to the same value in both the source and target databases. The value of the connect_timeout variable in the source database must be greater than 10. It is recommended to enable skip-name-resolve to reduce the possibility of connection timeouts. Binlog parameter requirements: The log_bin variable of the source database must be set to ON. The binlog_format variable of the source database must be set to ROW. The binlog_row_image variable of the source database must be set to FULL. When the gtid_mode variable is not set to ON in MySQL 5.6 or later, a warning will be triggered. It is recommended to enable gtid_mode. You cannot set the do_db or ignore_db filter conditions. The log_slave_updates variable must be set to ON when the source instance is a secondary database. It is recommended to retain binlogs in the source database for at least 3 days. Otherwise, if the task is paused or interrupted for a period longer than the binlog retention period, the task may fail due to the inability to resume. Foreign key dependencies: Foreign key dependencies can only be set to NO ACTION or RESTRICT. When a subset of databases and tables is migrated, all tables with foreign key dependencies must be complete. DTS provides a migration precision of 38 digits for the FLOAT data type and 308 digits for the DOUBLE data type. You need to verify whether this meets your expectations. The environment variable innodb_stats_on_metadata must be set to OFF. |
Target database requirements | The version of the target database must be greater than or equal to that of the source database. The storage capacity of the target database must be at least 1.2 times the size of the tablespaces to be migrated from the source database. (Full data migration concurrently executes INSERT operations, which can cause fragmentation in the tables of the target database. Therefore, after the full migration is complete, the table storage space in the target database is likely to be larger than that in the source instance.) The target database must not contain migration objects, such as tables or views, that have the same name as those in the source database. The max_allowed_packet parameter for the target database must be set to at least 4M. |
Configuration Item | Description |
Creating Mode | Select New Task. |
Billing Mode | Only pay-as-you-go is supported. After purchase, no charges are incurred during the task configuration and full migration phases. Charges are only applied during the incremental migration phase. However, due to the unified pay-as-you-go requirements of Tencent Cloud, a 1-hour fee will be frozen upon purchase. For detailed billing rules, see Billing Items and Rules. |
Source Instance Type | Select based on your source database type. It cannot be modified after purchase. Select MariaDB here. If your source database is a self-built MariaDB or a MariaDB from another cloud provider, select MariaDB here. If your source database is TencentDB for MariaDB, note that TencentDB for MariaDB has three kernel editions (MySQL/MariaDB/Percona). In this case, you do not need to distinguish the kernel edition and should still select MariaDB. |
Source Instance Region | This refers to the source region of the DTS data migration service. If the source database is a TencentDB database, select the region to which the source database belongs. If the source database is a self-built database or a database from another cloud provider, select the region closest to the source database, so that DTS can choose the optimal migration path and reduce migration duration. |
Target Instance Type | Select based on your target database type. It cannot be modified after purchase. Select MariaDB here. |
Target Instance Region | Select the target database region. |
Specification | Select the specifications for the migration link based on your business needs. For performance and billing details of different specifications, see Billing Overview. |
Quantity | A maximum of 10 migration tasks can be purchased in a single purchase. |
Setting Type | Configuration Item | Description |
Task Configuration | Task Name | Set a task name that is easy to identify. |
| Running Mode | Immediate execution: The task will be started immediately once the task check passes. Scheduled execution: Configure when the task is executed. It will automatically start at the specified time. |
| Automatic Retry | After configuration, if a migration task is temporarily interrupted due to network exceptions or similar issues, DTS will automatically retry and resume the task within the configured time range. No manual intervention is required. The supported time range for automatic retries is 5–720 minutes. |
Source Database Settings | Source Database Type | Source database type selected during purchase. It cannot be modified. |
| Service Provider | For a self-built database (including those on CVM) or a TencentDB database, select "Others". For a database from a third-party cloud provider, select the corresponding service provider. For this scenario, select "Others". |
| Region | Source database region selected during purchase. It cannot be modified. |
| Access Type | Select the access type based on your scenario. For this scenario, select Direct Connect or VPN Access. This scenario requires configuring the connection between VPN and IDC. For preparations of other access types, see Preparations Overview. Public Network: The source database is accessible through a public IP address. Self-built on CVM: The source database is deployed on Tencent CVM. Direct Connect: The source database can connect to Tencent Cloud Virtual Private Cloud (VPC) through DC. VPN Access: The source database can connect to Tencent Cloud VPC through VPN Access. Database: The source database is a TencentDB instance. CCN: The source database can connect to Tencent Cloud VPC through CCN. |
| VPC-Based Direct Connect Gateway/VPN Gateway | Only the VPC-based Direct Connect gateway is supported for DC. Confirm the network type associated with the gateway. For the VPN gateway, select the VPN gateway instance for access. |
| VPC | Select the VPC network and subnet associated with the VPC-based Direct Connect gateway and VPN gateway. |
| Host Address | IP address or domain name for accessing the source database. |
| Port | Port for accessing the source database. |
| Account | Database account for the source database. The account permissions should meet the requirements. |
| Password | The password for the account of the source database. |
| Connection Method | Secure Sockets Layer (SSL) connection refers to the use of SSL to establish a secure connection between DTS and the database, encrypting the transfer link. Selecting the SSL connection may increase the database connection response time. Generally, the private network link of Tencent Cloud is relatively secure, and the SSL connection is not required to be enabled. However, for scenarios where transfer methods such as public networks and DC are adopted, and data security requirements are high, the SSL connection is required to be enabled. Before the SSL connection is selected, SSL encryption is required to be enabled for the database first. |
Target Database Settings | Target Database Type | Target database type selected during purchase. It cannot be modified. |
| Region | Target database region selected during purchase. It cannot be modified. |
| Access Type | Select the access type based on your scenario. For this scenario, set it to Cloud Database. |
| Database Instance | Select the ID of the target database. |
| Account | Target database account. The account permissions should meet the requirements. |
| Password | The password for the account of the target database. |
| Connection Method | Secure Sockets Layer (SSL) connection refers to the use of SSL to establish a secure connection between DTS and the database, encrypting the transfer link. Selecting the SSL connection may increase the database connection response time. Generally, the private network link of Tencent Cloud is relatively secure, and the SSL connection is not required to be enabled. However, for scenarios where transfer methods such as public networks and DC are adopted, and data security requirements are high, the SSL connection is required to be enabled. Before the SSL connection is selected, SSL encryption is required to be enabled for the database first. |

Configuration Item | Description |
Migration Type | Select the migration type based on your scenario. Structural migration: Structured data, such as databases and tables, will be migrated. Full migration: The entire database will be migrated. The migration includes only the data that exists in the source database when the task starts and excludes any new data written after the migration begins. Full + incremental migration: Both existing data in the source database at the start of the task and any new data written during the migration process are migrated. You can select this option if data is continuously written to the source database during migration, and a non-stop, hitless migration is required. |
Migration Object | Entire instance: The entire instance will be migrated, excluding system databases such as information_schema, mysql, performance_schema, and sys. Specified objects: Migrate specified objects. |
Advanced Migration Object | Supports migrating stored procedures (Procedure), functions (Function), triggers (Trigger), and events (Event). The migration of advanced objects is a one-time operation. Only the advanced objects that exist in the source database before the task starts are migrated. Any new advanced objects added after the task starts will not be synchronized to the target database. Stored procedures and functions are migrated during the "source database export" phase. Triggers and events are migrated at the end of the task if there is no incremental task. If there is an incremental task, they are migrated after the user clicks Complete. Therefore, after Complete is clicked, the transition time of the task will increase slightly. |
Selected Object | Database and table mapping (database and table renaming) is supported. Hover the mouse pointer over a database or table name to display the Edit button. Click the button and fill in a new name in the pop-up window. When advanced objects are migrated, it is recommended not to rename databases and tables. Otherwise, the migration of advanced objects may fail. |
Whether to Synchronize Online DDL Temporary Tables | If you use the gh-ost or pt-osc tool to perform Online DDL operations on tables in the source database, DTS supports migrating the temporary tables generated by Online DDL changes to the target database. If you select gh-ost, DTS will migrate the temporary table names (`_tablename_ghc`, `_tablename_gho`, `_tablename_del`) generated by the gh-ost tool to the target database. If you select pt-osc, DTS will migrate the temporary table names (`_tablename_new`, `_tablename_old`) generated by the pt-osc tool to the target database. |

フィードバック