Skip to Content
Data TransmissionSource is MySQLMySQL migration to ClickHouse

Migration from MySQL to ClickHouse

UDTS supports migration from MySQL to ClickHouse. Supported MySQL versions include MySQL (including Percona) 5.5/5.6/5.7/8.0, MariaDB 10.1.2 and above, and PolarDB (MySQL compatible version). Supported ClickHouse versions range from 21.3 to 22.8.

Functional Limitations

  1. Supports single database migration, allowing for entire database migration or specified tables. It does not support migration of stored procedures, triggers, views, etc.
  2. Does not support the migration of DDL statements and delete statements.
  3. For incremental/full+incremental migration, binlog must be enabled on the source database, with the format set to ROW and the image set to FULL.

Query method:

show global variables like 'binlog_format'; show global variables like 'binlog_row_image';

Set method:

set global binlog_format = "ROW" ; set global binlog_row_image = "FULL" ;
  1. The target database only supports the cluster version of ClickHouse, and migration database tables only support cluster tables.
  2. When selecting “Manual Table Creation”, UDTS will not create the database table in the target database. Please pre-create the tables to be migrated in the target database before starting the migration task.
  3. When selecting “Automatic Table Creation”, if the database tables to be migrated do not exist in the target database, UDTS will automatically create them. If they already exist, UDTS will not recreate the table structure.
  4. When selecting “Automatic Table Creation”, the tables to be migrated must have a primary key or unique index. If this requirement is not met, please select “Manual Table Creation” and pre-create the tables in the target database.
  5. Incremental tasks can only choose “Manual Table Creation”.

Migration Content

Migration ContentDescription
Migration Structure1. Database and table structures and data
2. Before migration starts, it will not clean up existing databases and tables in the target database. If automatic table creation does not meet the requirements, customers can manually create tables in the target database in advance.
Migration ScopeOnly migrates databases and tables that can be found when creating a task. Newly added tables during task execution will not be automatically migrated temporarily
DDLNot supported
DMLinsert/update

Form Filling

Data Source Form

Parameter NameDescription
Address TypeSupports three methods: internal network address, external network address, and direct line address. Internal network address requires filling in VPC and subnet information; external network address supports both IP and domain name; direct line address supports both IP and domain name. If using a domain name, the user’s network should have an external network exit.
PortMySQL connection port
UsernameMySQL connection username
PasswordCorresponding user password for the MySQL database
Database NameName of the MySQL database. For all database transmission, please enter *. For specifying one database transfer, please enter the database name; for specifying multiple database transfers, sequentially input multiple database names, separated by commas. (If the database name contains spaces, incremental migration cannot be performed)
Table NameMySQL transfer table name. It is only effective when “Database Name” is specified as one database. If not filled, all tables in the specified database will be migrated by default. To specify one table transfer, please enter the table name; to specify multiple table transfers, enter multiple table names sequentially, separated by commas.
Max RateThe rate for external network/direct line is between 1-56 MB/s; for internal network it is between 1-1024 MB/s
NolocksDisabled by default. It needs to be enabled for competitor RDS services that cannot obtain SUPER privileges. For details on UDB obtaining SUPER privileges, please refer to FAQ

Transmission Target Form

Parameter NameDescription
TCP AddressClickHouse cluster’s TCP connection address, default port is 9000. Multiple addresses are connected with ”,”, e.g., 192.168.1.100:9000,192.168.1.120:9000
HTTP AddressClickHouse cluster’s HTTP connection address, default port is 8123. Multiple addresses are connected with ”,”, e.g., 192.168.1.100:8123,192.168.1.120:8123
UsernameClickHouse connection username
PasswordCorresponding user password for the ClickHouse database