-
Type:
Bug
-
Status: In Progress
-
Resolution: Unresolved
-
Affects Version/s: 7.0.X, 7.1.X, Master
-
Fix Version/s: None
-
Component/s: Core Infrastructure > Upgrade Framework
-
Labels:
-
Fix Priority:4
ConfigurationPersistenceManager.exists does not handle factory configs (so config admin interfaces with factory = true). This prevents from using ConfigurationUpgradeStepFactory for upgrading factory configs.
Steps to reproduce
- Start 7.0.x or 7.1.x
- Create a new instance for an arbitrary factory config, for example AnonymousUserConfiguration, OpenIdConnectProviderConfiguration, DestinationWorkerConfiguration etc.
This creates a config instance like com.xxx.OpenIdConnectProviderConfiguration-bab76645-06b9-44d0-8a5d-7b49802b1d43.config - Stop portal
- Write a new upgrade step for the affected module like this on 7.1.x or master:
package com.your.package; import com.liferay.portal.configuration.persistence.upgrade.ConfigurationUpgradeStepFactory; import com.liferay.portal.upgrade.registry.UpgradeStepRegistrator; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @Component(immediate = true, service = UpgradeStepRegistrator.class) public class TestUpgrade implements UpgradeStepRegistrator { @Override public void register(Registry registry) { registry.register( "a.b.c", "x.y.z", _configurationUpgradeStepFactory.createUpgradeStep( "com.old.factory.config.ClassName", "com.new.factory.config.ClassName")); } @Reference private ConfigurationUpgradeStepFactory _configurationUpgradeStepFactory; }
- Build and deploy the updated module
- Run the upgrade tool: java -jar LIFERAY_HOME/tools/portal-tools-db-upgrade-client/com.liferay.portal.tools.db.upgrade.client.jar
- Wait until it finishes the upgrade
Expected Result: The Configuration_ table contains the renamed factory and instance.
Actual Result: The record in the Configuration_ table is untouched, no renamed configs created
It's the same if you are using a .cfg or .config file.
- Discovered while testing
-
LPS-89368 Create upgrade process to update the System Settings configs for OpenID Connect when upgrading to 7.1 and 7.2
-
- Closed
-