We are upgrading from liferay-dxp-tomcat-2023.q4.4 to liferay-dxp-tomcat-2025.q1.15-lts. Currently we are using Mysql 8.0.41-azure on our server which is compatible with liferay-dxp-tomcat-2025.q1.15-lts.
Liferay Version: 2025.Q1.15
Database: MySQL 8.0.41-Azure
Upgrade Tool: portal-tools-db-upgrade-client
We are getting below error while running DB upgrade tool on test environment. Please find below the error logs:
2025-08-13 10:20:28.493 INFO [main][UpgradeProcess:119] Upgrading com.liferay.portal.kernel.upgrade.CTModelUpgradeProcess
2025-08-13 10:20:28.494 INFO [main][LoggingTimer:74] Starting com.liferay.portal.kernel.upgrade.CTModelUpgradeProcess#doUpgrade#AnnouncementsDelivery
2025-08-13 10:20:28.605 INFO [main][LoggingTimer:35] Completed com.liferay.portal.kernel.upgrade.CTModelUpgradeProcess#doUpgrade#AnnouncementsDelivery in 111 ms
2025-08-13 10:20:28.605 INFO [main][UpgradeProcess:137] Failed upgrade process com.liferay.portal.kernel.upgrade.CTModelUpgradeProcess in 112 ms
2025-08-13 10:20:28.606 INFO [main][PortalUpgradeProcess:336] Failed upgrade process com.liferay.portal.upgrade.PortalUpgradeProcess in 534 ms
2025-08-13 10:20:28.626 ERROR [main][DBUpgrader:70] com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
at com.liferay.portal.upgrade.PortalUpgradeProcess.upgrade(PortalUpgradeProcess.java:330) ~[portal-impl.jar:?]
at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:172) ~[portal-kernel.jar:?]
at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:148) ~[portal-kernel.jar:?]
at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:176) ~[portal-impl.jar:?]
at com.liferay.portal.tools.DBUpgrader.upgradePortal(DBUpgrader.java:300) ~[portal-impl.jar:?]
at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:171) [portal-impl.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:45) [com.liferay.portal.tools.db.upgrade.client.jar:?]
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:128) ~[portal-kernel.jar:?]
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:146) ~[portal-kernel.jar:?]
at com.liferay.portal.upgrade.PortalUpgradeProcess.doUpgrade(PortalUpgradeProcess.java:355) ~[portal-impl.jar:?]
at com.liferay.portal.upgrade.PortalUpgradeProcess.upgrade(PortalUpgradeProcess.java:325) ~[portal-impl.jar:?]
... 8 more
Caused by: java.sql.SQLSyntaxErrorException: This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121) ~[mysql.jar:8.3.0]