Fórum

UpgradeProcess for Data Not working in 7.0 ga5

thumbnail
Sunit Chatterjee, modificado 6 Anos atrás.

UpgradeProcess for Data Not working in 7.0 ga5

Junior Member Postagens: 28 Data de Entrada: 18/05/17 Postagens Recentes
Hi,

We were earlier using 7.0 ga4 version of liferay, and had created a Data upgrade process based on this documentation - Creating an Upgrade Process for your App

We had created upto 14 upgrade steps and it was working correctly.

Post upgrade to 7.0 ga5, we create the upgrade step from version 1.0.14 to 1.0.15 (our internal upgrade versions).

The upgrade process does not seems to run.

I also verified the auto upgrade property in the file => bundles/tomcat-8.0.32/webapps/ROOT/WEB-INF/classes/portal-developer.properties

schema.module.build.auto.upgrade=true
...
...


Is there anything I am missing, or anything else needs to be configured or changed for the upgrade process to work?

Thanks
Sunit
thumbnail
Alberto Chaparro, modificado 6 Anos atrás.

RE: UpgradeProcess for Data Not working in 7.0 ga5

Liferay Master Postagens: 549 Data de Entrada: 25/04/11 Postagens Recentes
Hi Sunit,

The upgrade should be executed after deploying the module. Could you share how you have defined the upgrade process?

Regards.
thumbnail
Sunit Chatterjee, modificado 6 Anos atrás.

RE: UpgradeProcess for Data Not working in 7.0 ga5

Junior Member Postagens: 28 Data de Entrada: 18/05/17 Postagens Recentes
Hi Alberto,

Thanks for the quick reply.

This is what I have done.
This was working for the previous 14 upgrade steps.
Post GA5, I have only added the 15th step.
I have also build and re-deployed the module many times.

  • Created a class that implements UpgradeStepRegistrar
  • Override the 'register' method where I register the individual upgrade steps
    @Component(immediate = true, service = UpgradeStepRegistrator.class)
    public class CustomDataUpgradeProcess implements UpgradeStepRegistrator  {
     .......
     .......
    @Override
    	public void register(Registry registry) {
                .......
                .......
                registry.register(moduleName, "0.0.0", "1.0.0", new UpgradeStepOne());
                registry.register(moduleName, "1.0.0", "1.0.1", new UpgradeStepTwo());
                registry.register(moduleName, "1.0.1", "1.0.2", new UpgradeStepThree());
                .......
                .......
                registry.register(moduleName, "1.0.14", "1.0.15", new UpgradeStepFifteen());
                .......
           }
    
  • Each upgrade step is a separate class which extends from UpgradeProcess, and overrides the doUpgrade method
    
    public class UpgradeStepFifteen extends UpgradeProcess {
    	@Override
    	protected void doUpgrade() throws Exception {
                .......
           }
    }
    
thumbnail
Alberto Chaparro, modificado 6 Anos atrás.

RE: UpgradeProcess for Data Not working in 7.0 ga5

Liferay Master Postagens: 549 Data de Entrada: 25/04/11 Postagens Recentes
Hi Sunit,

Have you set this property to true?
https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/running-the-upgrade-process#upgrading-modules-individually

If so, the module upgrade processes don't run automatically.

Also, have you tried to execute it manually? You can execute upgrade:check to get pending upgrade processes, upgrade:list {module_name} to get the registered upgrade processes and upgrade:execute {module_name} to execute it in Gogo Console.

Which is your require-schema-version value in bnd.bnd file?

Please, let us know about the results.