Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-89497

ConfigurationPersistenceManager "exists" does not handle factory configs: ConfigurationUpgradeStepFactor can't be used to upgrade such configurations


    • Fix Priority:


      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

      1. Start 7.0.x or 7.1.x
      2. 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
      3. Stop portal
      4. 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 {
        	public void register(Registry registry) {
        			"a.b.c", "x.y.z",
        	private ConfigurationUpgradeStepFactory _configurationUpgradeStepFactory;
      5. Build and deploy the updated module
      6. Run the upgrade tool: java -jar LIFERAY_HOME/tools/portal-tools-db-upgrade-client/com.liferay.portal.tools.db.upgrade.client.jar
      7. 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.


          Issue Links



              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  17 weeks, 2 days ago