__tencentdb__
in the source database to record the data comparison information during the migration task.__tencentdb__
system database in the source database will not be deleted after the migration task ends.__tencentdb__
system database uses a single-threaded connection wait mechanism and occupies a very small space, about 0.01%–0.1% of the storage space of the source database; for example, if the source database is 50 GB, __tencentdb__
will be about 5–50 MB. Therefore, it has almost no impact on the performance of the source database and will not preempt resources.__tencentdb__
database in advance in the source TDSQL for MySQL database.CREATE USER 'migration account'@'%' IDENTIFIED BY 'migration password';GRANT SELECT,RELOAD,LOCK TABLES,REPLICATION CLIENT,REPLICATION SLAVE,SHOW DATABASES,SHOW VIEW,PROCESS ON *.* TO 'migration account'@'%';// If the source database is a TDSQL for MySQL database, you need to submit a ticket to authorize `RELOAD`; otherwise, you can authorize by referring to the sample codeGRANT INSERT, UPDATE, DELETE, DROP, SELECT, INDEX, ALTER, CREATE ON `__tencentdb__`.* TO 'migration account'@'%';
information_schema
, sysdb
, test
, sys
, performance_schema
, __tencentdb__
, and mysql
cannot be migrated.STATEMENT
format, the migration will fail.STATEMENT
format into the source database.__tencentdb__
during incremental migration.Operation Type | Synchronizable SQL Operation |
DML | INSERT, UPDATE, DELETE, REPLACE |
DDL | TABLE: CREATE TABLE, ALTER TABLE, DROP TABLE, TRUNCATE TABLE VIEW: CREATE VIEW, DROP VIEW INDEX: CREATE INDEX, DROP INDEX DATABASE: CREATE DATABASE, ALTER DATABASE, DROP DATABASE CREATE TABLE table name AS SELECT is not supported. |
Type | Environment Requirements |
Requirements for the source database | The source and target databases can be connected. Requirements for instance parameters: table_row_format cannot be set to FIXED .The values of the lower_case_table_names variable in both the source and target databases must be the same.The max_allowed_packet parameter in the target database must be at least 4 MB.The connect_timeout variable in the source database must be greater than or equal to 10.Requirements for binlog parameters: The binlog_format variable in the source database must be set to ROW .The log_bin variable in the source database must be set to ON .The binlog_row_image variable in the source database must be set to FULL .On v5.6 or later, if the gtid_mode variable in the source database is not ON , a warning will be triggered. We recommend you enable gtid_mode .It is not allowed to set do_db and ignore_db .If the source instance is a replica database, the log_slave_updates variable must be set to ON .We recommend that you retain the binlog of the source database for at least three days; otherwise, the task cannot be resumed from the checkpoint and will fail. Foreign key dependency: Foreign key dependency can be set to only one of the following two types: NO ACTION and RESTRICT .During partial table migration, tables with foreign key dependency must be migrated. The environment variable innodb_stats_on_metadata must be set to OFF . |
Requirements for the target database | If the target database is a distributed database, we recommend you manually create a partitioned table and plan the shardkey in advance; otherwise, DTS will create a table in the target database based on the table style of the source database. If the source database is a standalone instance, the target database will be created as a single table. The target database version must be later than or equal to the source database version. The target database space must be at least 1.2 times the space of databases/tables to be migrated in the source database. The target database cannot have tables that conflict with the source database. |
Configuration Items | Description |
Source Instance Type | Select the source database type, which cannot be changed after purchase. Here, select MySQL. TDSQL for MySQL has three kernel versions (MySQL/MariaDB/Percona). No matter which kernel is used, you still need to select TDSQL for MySQL as the source database type. |
Source Instance Region | Select the source database region. |
Target Instance Type | Select the target database type, which cannot be changed after purchase. Here, select TDSQL for MySQL. |
Target Instance Region | Select the target database region. |
Specification | Select the specification of the migration link based on your business conditions. For the performance and billing details of different specifications, see Billing Overview. |
Category | Configuration Items | Description |
Task Configuration | Task Name | Set a task name that is easy to identify. |
| Running Mode | Immediate execution: The task will be started immediately after the task verification is passed. Scheduled execution: You need to configure a task execution time and the task will be started automatically then. |
| Tag | Tags are used to manage resources by category in different dimensions. If the existing tags do not meet your requirements, go to the console to create more. |
Source Database Settings | Source Database Type | The source database type selected during purchase, which cannot be changed. |
| Region | The source database region selected during purchase, which cannot be changed. |
| Access Type | Select Database. |
| Database Instance | Select the instance ID of the source database. |
| Account | Account of the source TDSQL for MySQL database, which must have the required permissions. |
| Password | Password of the source TDSQL for MySQL database account. |
Target Database Settings | Target Database Type | The target database type selected during purchase, which cannot be changed. |
| Region | The target database region selected during purchase, which cannot be changed. |
| Access Type | Select Database. |
| Database Instance | Select the ID of the target TDSQL for MySQL instance. |
| Account | Account of the target TDSQL for MySQL database, which must have the required permissions. |
| Password | Password of the target TDSQL for MySQL database account. |
Configuration Items | Description |
Migration Type | Select an option as needed. Structural migration: Structured data such as databases and tables in the database will be migrated. Full migration: The entire database will be migrated. The migrated data will only be existing content of the source database when the task is initiated but not include the incremental data written to the source database after the task is initiated. Full + Incremental migration: The migrated data will include the existing content of the source database when the task is initiated as well as the incremental data written to the source database after the task is initiated. If there are data writes to the source database during migration, and you want to smoothly migrate the data in a non-stop manner, select this option. |
Migration Object | Entire instance: Migrate the entire database instance excluding the system databases such as information_schema , mysql , performance_schema , and sys .Specified objects: Migrate specified objects. |
Specify object | Select the objects to be migrated in Source Database Object and move them to the Selected Object box. |
Was this page helpful?