Legacy Knowledge Base
Published Sep. 10, 2025

Illegal mix of collations during upgrade process

Written By

Dávid Hegedüs

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • You might encounter the following error or similar during the upgrade process if your database's collation differs from the collation of the tables:
    com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='
    at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:136) ~[portal-kernel.jar:?]
    at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor._executeUpgradeInfos(UpgradeExecutor.java:198) ~[bundleFile:?]
    at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:144) ~[bundleFile:?]
    at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.execute(UpgradeExecutor.java:116) ~[bundleFile:?]
    at com.liferay.portal.upgrade.internal.registry.UpgradeStepRegistratorTracker$UpgradeStepRegistratorServiceTrackerCustomizer.addingService(UpgradeStepRegistratorTracker.java:184) [bundleFile:?]
    at com.liferay.portal.upgrade.internal.registry.UpgradeStepRegistratorTracker$UpgradeStepRegistratorServiceTrackerCustomizer.addingService(UpgradeStepRegistratorTracker.java:126) [bundleFile:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943) [org.eclipse.osgi.jar:?]

 

Environment

  • Liferay DXP 7.0+
  • Upgrades

 

Resolution

  • The issue occurs when importing dumps in a new database before Liferay Upgrade. After importing the data, you can check if there is any Collation mismatch (MySQL):
    USE lportal;

    # Check the database

    SELECT @@character_set_database, @@collation_database;

    # Check all the tables

    SHOW TABLE STATUS;
  • If you find any differences between table and its database, you will need to do one of this options:
  • For explanation purposes, there will be a database A with collation utf8mb4_0900_ai_ci, and a database B with collation utf8mb4_general_ci. The dump is exported from database A and imported in database B.
  • Option 1: Keep the collation of database A
    • It is usually the easiest option. 
    • Before running any upgrade, you will need to update Database B:
      ALTER DATABASE lportal CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
    • Run the upgrade as normal.
  • Option 2: Keep the collation of database B
    • Before running any upgrade, you will need to alter every table imported in the database B. 
      ALTER TABLE `account_` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
      ALTER TABLE `address` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
      ALTER TABLE ...
      ...
    • Run the upgrade as normal.
  • If you have any doubt in which collation you may choose, create a new support ticket with your enterprise subscription.

 

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base