Liferay 6.2 CE GA5 Database Migration from SQL Server to MySQLLiferay 6.2 CE GA5 Database Migration from SQL Server to MySQLhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1113377712024-03-29T02:01:05Z2024-03-29T02:01:05ZRE: Liferay 6.2 CE GA5 Database Migration from SQL Server to MySQLMashuk Choudhuryhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1114444862018-11-05T09:38:19Z2018-11-05T09:38:19Z<p>Hi Alberto,</p>
<p> </p>
<p>I managed to resolve the issue by setting a character limit on the
troublesome index, which in my case was portletId.</p>
<p> </p>
<pre>
ERROR: Error executing 'CREATE TABLE IF NOT EXISTS `SchemaName`.`JournalContentSearch` (
`contentSearchId` BIGINT NOT NULL,
`groupId` BIGINT NULL,
`companyId` BIGINT NULL,
`privateLayout` SMALLINT NULL,
`layoutId` BIGINT NULL,
`portletId` VARCHAR(200) CHARACTER SET 'utf8mb4' NULL,
`articleId` VARCHAR(75) CHARACTER SET 'utf8mb4' NULL,
INDEX `IX_9207CB31` (`articleId` ASC),
INDEX `IX_6838E427` (`groupId` ASC, `articleId` ASC),
INDEX `IX_20962903` (`groupId` ASC, `privateLayout` ASC),
INDEX `IX_7CC7D73E` (`groupId` ASC, `privateLayout` ASC, `articleId` ASC),
INDEX `IX_B3B318DC` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC),
INDEX `IX_7ACC74C9` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC, <span
style="font-size: 14.0px;"><strong>`portletId`(190)</strong></span> ASC),
UNIQUE INDEX `IX_C3AA93B8` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC, <span
style="font-size: 14.0px;"><strong>`portletId`(190)</strong></span> ASC, `articleId` ASC),
INDEX `IX_8DAF8A35` (<span style="font-size: 14.0px;"><strong>`portletId`(190)</strong></span> ASC))'
Index column size too large. The maximum column size is 767 bytes..
SQL Error: 1709</pre>
<p>Thanks</p>
<p>Mashuk</p>Mashuk Choudhury2018-11-05T09:38:19ZRE: Liferay 6.2 CE GA5 Database Migration from SQL Server to MySQLAlberto Chaparrohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1113405242018-10-26T15:57:03Z2018-10-26T15:57:03ZHi Mashuk,<br /><br />As far as I remember in Mysql 5.6, you have to modify each create table statement to designate for UTF8MB4. This constraint forces you to change all the create table statements.<br /><br />Could you use Mysql 5.7 where this restriction is not needed?<br /><br />If the problem persist, can you try to remove the problematic indexes before doing the migration and try to recreate them (with a limitation for varchar fields in the final database)?<br /><br />I hope it helps.Alberto Chaparro2018-10-26T15:57:03ZLiferay 6.2 CE GA5 Database Migration from SQL Server to MySQLMashuk Choudhuryhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1113377702018-10-26T11:42:05Z2018-10-26T11:42:05Z<html><head></head><body>Hi,<br><br>We are migrating a Liferay instance (6.2 CE GA5) which is currently running off MS SQL Server 2012 and into MySQL 5.6. MySQL Workbench has a migration tool which we used but we are getting errors around Index sizes, see below:<br><pre><code>ERROR: Error executing 'CREATE TABLE IF NOT EXISTS `SchemaName`.`JournalContentSearch` (
`contentSearchId` BIGINT NOT NULL,
`groupId` BIGINT NULL,
`companyId` BIGINT NULL,
`privateLayout` SMALLINT NULL,
`layoutId` BIGINT NULL,
`portletId` VARCHAR(200) CHARACTER SET 'utf8mb4' NULL,
`articleId` VARCHAR(75) CHARACTER SET 'utf8mb4' NULL,
INDEX `IX_9207CB31` (`articleId` ASC),
INDEX `IX_6838E427` (`groupId` ASC, `articleId` ASC),
INDEX `IX_20962903` (`groupId` ASC, `privateLayout` ASC),
INDEX `IX_7CC7D73E` (`groupId` ASC, `privateLayout` ASC, `articleId` ASC),
INDEX `IX_B3B318DC` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC),
INDEX `IX_7ACC74C9` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC, `portletId` ASC),
UNIQUE INDEX `IX_C3AA93B8` (`groupId` ASC, `privateLayout` ASC, `layoutId` ASC, `portletId` ASC, `articleId` ASC),
INDEX `IX_8DAF8A35` (`portletId` ASC))'
Index column size too large. The maximum column size is 767 bytes..
SQL Error: 1709</code></pre>Since the characterset is utf8mb4, each character is using 4 bytes per character and with the portletid set to VARCHAR(200), that is exceeding the limit. <br>I have experimented by changing the character limits, which does migrate the DB, but then Liferay does not s