Illegal mix of collations during upgrade process

Issue

  • You might encounter the following error or similar during the upgrade process for certain upgrade steps if your database's collation differs from what Liferay would expect which is utf8_general_ci:
    com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:136) ~[portal-kernel.jar:?]
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:157) ~[portal-kernel.jar:?]
      at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor$UpgradeInfosRunnable.run(UpgradeExecutor.java:230) ~[?:?]
      at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:134) [bundleFile:?]
      at com.liferay.portal.upgrade.internal.executor.SwappedLogExecutor.execute(SwappedLogExecutor.java:51) [bundleFile:?]
      at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:158) ~[bundleFile:?]
      at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.execute(UpgradeExecutor.java:118) ~[bundleFile:?]
    ...

Environment

  • Liferay DXP 7.0+

Resolution

  • Add theconnectionCollation=utf8_unicode_ciparameter to thejdbc.default.urlproperty in the portal-upgrade-database.properties
  • Make sure to use utf8_general_ci collation in your database
  • You can also convert existing database with the wrong collation

Additional Information

Was this article helpful?
0 out of 0 found this helpful