|
| 1 | +--- |
| 2 | +title: Article about known issues/migration limitations with online migrations to Azure Database for MySQL | Microsoft Docs |
| 3 | +description: Learn about known issues/migration limitations with online migrations to Azure Database for MySQL. |
| 4 | +services: database-migration |
| 5 | +author: HJToland3 |
| 6 | +ms.author: jtoland |
| 7 | +manager: |
| 8 | +ms.reviewer: |
| 9 | +ms.service: database-migration |
| 10 | +ms.workload: data-services |
| 11 | +ms.custom: mvc |
| 12 | +ms.topic: article |
| 13 | +ms.date: 08/24/2018 |
| 14 | +--- |
| 15 | + |
| 16 | +# Known issues/migration limitations with online migrations to Azure DB for MySQL |
| 17 | + |
| 18 | +Known issues and limitations associated with online migrations from MySQL to Azure Database for MySQL are described in the following sections. |
| 19 | + |
| 20 | +## Online migration configuration |
| 21 | +- The source MySQL Server version must be version 5.6.35, 5.7.18 or later |
| 22 | +- Azure Database for MySQL supports: |
| 23 | + - MySQL community edition |
| 24 | + - InnoDB engine |
| 25 | +- Same version migration. Migrating MySQL 5.6 to Azure Database for MySQL 5.7 isn't supported. |
| 26 | +- Enable binary logging in my.ini (Windows) or my.cnf (Unix) |
| 27 | + - Set Server_id to any number larger or equals to 1, for example, Server_id=1 (only for MySQL 5.6) |
| 28 | + - Set log-bin = <path> (only for MySQL 5.6) |
| 29 | + - Set binlog_format = row |
| 30 | + - Expire_logs_days = 5 (recommended - only for MySQL 5.6) |
| 31 | +- User must have the ReplicationAdmin role. |
| 32 | +- Collations defined for the source MySQL database are the same as the ones defined in target Azure Database for MySQL. |
| 33 | +- Schema must match between source MySQL database and target database in Azure Database for MySQL. |
| 34 | +- Schema in target Azure Database for MySQL must not have foreign keys. Use the following query to drop foreign keys: |
| 35 | + ``` |
| 36 | + SET group_concat_max_len = 8192; |
| 37 | + SELECT SchemaName, GROUP_CONCAT(DropQuery SEPARATOR ';\n') as DropQuery, GROUP_CONCAT(AddQuery SEPARATOR ';\n') as AddQuery |
| 38 | + FROM |
| 39 | + (SELECT |
| 40 | + KCU.REFERENCED_TABLE_SCHEMA as SchemaName, KCU.TABLE_NAME, KCU.COLUMN_NAME, |
| 41 | + CONCAT('ALTER TABLE ', KCU.TABLE_NAME, ' DROP FOREIGN KEY ', KCU.CONSTRAINT_NAME) AS DropQuery, |
| 42 | + CONCAT('ALTER TABLE ', KCU.TABLE_NAME, ' ADD CONSTRAINT ', KCU.CONSTRAINT_NAME, ' FOREIGN KEY (`', KCU.COLUMN_NAME, '`) REFERENCES `', KCU.REFERENCED_TABLE_NAME, '` (`', KCU.REFERENCED_COLUMN_NAME, '`) ON UPDATE ',RC.UPDATE_RULE, ' ON DELETE ',RC.DELETE_RULE) AS AddQuery |
| 43 | + FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU, information_schema.REFERENTIAL_CONSTRAINTS RC |
| 44 | + WHERE |
| 45 | + KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME |
| 46 | + AND KCU.REFERENCED_TABLE_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA |
| 47 | + AND KCU.REFERENCED_TABLE_SCHEMA = ['schema_name']) Queries |
| 48 | + GROUP BY SchemaName; |
| 49 | + ``` |
| 50 | +
|
| 51 | + Run the drop foreign key (which is the second column) in the query result. |
| 52 | +- Schema in target Azure Database for MySQL must not have any triggers. To drop triggers in target database: |
| 53 | + ``` |
| 54 | + SELECT Concat('DROP TRIGGER ', Trigger_Name, ';') FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA = 'your_schema'; |
| 55 | + ``` |
| 56 | +
|
| 57 | +## Datatype limitations |
| 58 | +- **Limitation**: If there's a JSON datatype in the source MySQL database, migration will fail during continuous sync. |
| 59 | +
|
| 60 | + **Workaround**: Modify JSON datatype to medium text or longtext in source MySQL database. |
| 61 | +
|
| 62 | +- **Limitation**: If there's no primary key on tables, continuous sync will fail. |
| 63 | + |
| 64 | + **Workaround**: Temporarily set a primary key for the table for migration to continue. You can remove the primary key after data migration is complete. |
| 65 | +
|
| 66 | +## LOB limitations |
| 67 | +Large Object (LOB) columns are columns that could grow large in size. For MySQL, Medium text, Longtext, Blob, Mediumblob, Longblob, etc. are some of the datatypes of LOB. |
| 68 | +
|
| 69 | +- **Limitation**: If LOB data types are used as primary keys, migration will fail. |
| 70 | +
|
| 71 | + **Workaround**: Replace primary key with other datatypes or columns that aren't LOB. |
| 72 | +
|
| 73 | +- **Limitation**: If the length of Large Object (LOB) column is bigger than 32 KB, data might be truncated at the target. You can check the length of LOB column using this query: |
| 74 | + ``` |
| 75 | + SELECT max(length(description)) as LEN from catalog; |
| 76 | + ``` |
| 77 | +
|
| 78 | + **Workaround**: If you have LOB object that is bigger than 32 KB, contact engineering team at [[email protected]](mailto:[email protected]). |
| 79 | +
|
| 80 | +## Other limitations |
| 81 | +- A password string that has opening and closing curly brackets { } at the beginning and end of the password string isn't supported. This limitation applies to both connecting to source MySQL and target Azure Database for MySQL. |
| 82 | +- The following DDLs aren't supported: |
| 83 | + - All partition DDLs |
| 84 | + - Drop table |
| 85 | + - Rename table |
| 86 | +- Using the *alter table <table_name> add column <column_name>* statement to add columns to the beginning or to the middle of a table isn't supported. THe *alter table <table_name> add column <column_name>* adds the column at the end of the table. |
| 87 | +- Indexes created on only part of the column data aren't supported. The following statement is an example that creates an index using only part of the column data: |
| 88 | + ``` |
| 89 | + CREATE INDEX partial_name ON customer (name(10)); |
| 90 | + ``` |
| 91 | +
|
| 92 | +- In DMS, the limit of databases to migrate in one single migration activity is four. |
0 commit comments