MySQL Migration to MAXIR
UDTS supports migration from MySQL to MAXIR. Supported MySQL versions include MySQL (including Percona) 5.5/5.6/5.7/8.x.
1. Functional Limitations
1.1 Source MySQL Limitations
1.1.1 For incremental/full+incremental migration, the source database needs to have binlog enabled with the format set to ROW, and 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.1.2 The source tables to be migrated must have a primary key.
1.2 Target MAXIR Limitations
1.2.1 When creating a table in MAXIR, you need to specify DISTRIBUTED BY and CLUSTER BY column attributes, for example:
CREATE TABLE trade (
id bigint,
"date" date,
shopid int NOT NULL,
sku varchar NOT NULL,
price decimal(18, 4),
primary key(date, id)
) DISTRIBUTED BY (id) CLUSTER BY (date, id);
a. CLUSTER BY columns are recommended to be the same as the primary key or part of the primary key, for example, date or {date, id}. b. The column for DISTRIBUTED BY needs to be one of the primary key columns, and it needs to be a column with high cardinality. In this example, it can only be id, not date.
1.2.2 When migrating with UDTS to MAXIR, if the target table does not exist, it will be automatically created. The table creation rules are as follows, and customers need to assess in advance. If they do not meet business requirements, customers can create tables in the target database in advance:
1. CLUSTER BY will be consistent with the table's primary key.
2. DISTRIBUTED BY will use the primary key, and for composite keys, it will use the first field.
2. Migration Content
Migration Content | Description |
---|---|
Schema Migration | 1. Database and table structure (only primary key index is migrated, MAXIR only requires the primary key) and data. 2. The existing schema and tables in the target database will not be cleaned before migration. If the automatic table creation does not meet requirements, customers can manually create tables in the target database in advance. |
Migration Scope | Only the databases and tables that can be queried when creating the migration task will be migrated. Newly added tables during task execution will not be automatically migrated for now. |
DDL | Not supported |
DML | insert/update/delete |
3. Form Submission
Data Source Form
Parameter | Description |
---|---|
Address Type | Supports three ways: intranet address, internet address, and dedicated line address. Intranet address requires VPC and subnet information; internet address supports both IP and domain name; dedicated line address supports both IP and domain name. If using a domain name, the user network must have an internet gateway. |
Port | MySQL connection port |
Username | MySQL connection username |
Password | Password for the corresponding MySQL user |
Database Name | The name of the MySQL database. For transferring all databases, enter *; to transfer a specific database, enter the database name; to transfer multiple databases, enter each database name separated by commas in English. (If the database name contains spaces, incremental migration cannot be performed) |
Table Name | MySQL table name for transfer. Only valid when “Database Name” is a specified database. If not filled in, all tables in the specified database will be migrated by default. To transfer a specific table, enter the table name; to transfer multiple tables, enter each table name separated by commas in English. |
Maximum Rate | The rate range for internet/dedicated line is 1-56 MB/s; the rate range for intranet is 1-1024 MB/s |
Transfer Target Form
Parameter | Description |
---|---|
Address Type | Currently, only intranet is supported |
Port | MAXIR connection port |
Username | MAXIR connection username |
Password | Password for the corresponding MAXIR database user |
Database Name | The name of the Database in the target MAXIR for migration. The multiple Database names from the source MySQL will be created as Schemas under the specified Database in the target MAXIR. For example: If source MySQL migration includes A.t1, A.t2, B.t1, B.t2 to the target MAXIR's target database, the migration result will be seen in MAXIR as: target.A.t1,target.A.t2,target.B.t1,target.B.t2 |
4. Permissions Requirements
Category | Description |
---|---|
Source MySQL | SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT |
Target MAXIR | Must have owner permission for the database to be migrated, or rolcreatedb permission |
5. Data Type Mapping
MySQL Data Type | MAXIR Data Type |
---|---|
BIT(1) | BOOL |
TINYINT SMALLINT |
INT2 |
MEDIUMINT INT INTEGER YEAR |
INT4 |
TINYINT UNSIGNED SMALLINT UNSIGNED MEDIUMINT UNSIGNED INT UNSIGNED INTEGER UNSIGNED BIGINT UNSIGNED |
NUMERIC(20, 0) |
BIGINT | INT8 |
DECIMAL(p, s) DECIMAL(p, s) UNSIGNED NUMERIC(p, s) NUMERIC(p, s) UNSIGNED |
NUMERIC(p,s) |
FLOAT FLOAT UNSIGNED |
FLOAT4 |
DOUBLE DOUBLE UNSIGNED REAL REAL UNSIGNED |
FLOAT8 |
CHAR VARCHAR |
VARCHAR |
TINYTEXT MEDIUMTEXT TEXT LONGTEXT ENUM JSON |
TEXT |
DATE | DATE |
TIME | TIME |
DATETIME | TIMESTAMP |
TIMESTAMP | TIMESTAMPTZ |
BINARY VARBINAR BIT(p) TINYBLOB MEDIUMBLOB BLOB LONGBLOB GEOMETRY |
BYTEA (But does not support data writing) |