Issue
- When trying to upgrade the Knowledge Base plugin as part of upgrading from Liferay Portal 6.2 to Liferay DXP 7.1, an error like this may appear with:
upgrade:execute com.liferay.knowledge.base.service
INFO - Upgrading com.liferay.knowledge.base.internal.upgrade.v2_0_2.UpgradeKBArticle
INFO - Failed upgrade process com.liferay.knowledge.base.internal.upgrade.v2_0_2.UpgradeKBArticle in 6 ms
. . .
ERROR [main][com_liferay_portal_upgrade_impl:97] Invocation to listener threw exception
com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: ORA-01408: such column list already indexed_ [Sanitized]
Environment
- Liferay Portal 6.2 EE with Knowledge Base plugin deployed
- Liferay DXP 7.1
Resolution
- With the Knowledge Base plugin, the upgrade process creates a temporary index to ensure that the _renameConflictingKBArticleFriendlyURLs() and _renameConflictingKBFolderFriendlyURLs() do their job at finding unique URL title values for KBArticles and KBFolders respectively.
- After that process finishes, the index is dropped by this statement:
protected void doUpgrade() throws Exception {
runSQL(
"create index IX_TEMP on KBArticle (groupId, kbFolderId, " +
"urlTitle[$COLUMN_LENGTH:75$])");
try {
boolean changed = true;
while (changed) {
changed = _renameConflictingKBArticleFriendlyURLs();
}
changed = true;
while (changed) {
changed = _renameConflictingKBFolderFriendlyURLs();
}
}
finally {
runSQL("drop index IX_TEMP on KBArticle");
}
}
- Since this index is part of the upgrade process only and is not used by Liferay in either Portal 6.2 or DXP 7.1, the best approach is to simply drop this index.
- Please be sure to backup the database prior to making any changes.
- Then, check that the index "IX_TEMP" exists for the KbArticle table.
- If it does, it should be safe to drop this index when Liferay is stopped and you can confirm that no one is accessing the index.