RE: Upgrade Liferay CE from 7.1 to 7.3 fails for obscure reason

Teddy Kossoko, modified 5 Years ago. Junior Member Posts: 42 Join Date: 3/5/18 Recent Posts
I'm trying to upgrade my portlets and Liferay 7.1 to the version 7.3.3.
I downloaded the portal-tools-db-upgrade-client and configure these files:
app-server.properties
dir=C:\Users\tkossoko\Documents\Capgemini\Biomass\liferay-ce-portal-7.3.3-ga4\tomcat-9.0.33
extra.lib.dirs=C://Users//tkossoko//Documents//Capgemini//Biomass//liferay-ce-portal-7.3.3-ga4//tomcat-9.0.33//bin
global.lib.dir=C://Users//tkossoko//Documents//Capgemini//Biomass//liferay-ce-portal-7.3.3-ga4//tomcat-9.0.33//lib
portal.dir=C://Users//tkossoko//Documents//Capgemini//Biomass//liferay-ce-portal-7.3.3-ga4//tomcat-9.0.33//webapps//ROOT
server.detector.server.id=tomcat



 portal-upgrade-database.properties
jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.password=myPwd
jdbc.default.url=jdbc:postgresql://localhost:5432/liferay-full-map
jdbc.default.username=liferay

 portal-upgrade-ext.properties
liferay.home=C:/Users/tkossoko/liferay-workspace/BMAP-Source/BMAP-source
When i run this command
 ./db_upgrade.sh -j "-Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.timezone=GMT -Xmx10240m"

I got :
JVM arguments: -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.timezone=GMT -Xmx10240m -Dexternal-properties=portal-upgrade.properties -Dserver.detector.server.id=tomcat
Loading jar:file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/lib/portal-impl.jar!/portal.properties
Loading jar:file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/com.liferay.portal.tools.db.upgrade.client.jar!/portal-upgrade.properties
Loading file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/portal-upgrade-ext.properties
Loading file:/C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client/portal-upgrade-database.properties
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:54)
Caused by: java.lang.NoSuchFieldError: MARIADB
        at com.liferay.portal.dao.db.MariaDBDBFactory.getDBType(MariaDBDBFactory.java:33)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.liferay.portal.dao.db.DBManagerImpl.<init>(DBManagerImpl.java:64)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.liferay.portal.util.InitUtil.init(InitUtil.java:168)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:210)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:199)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:126)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... 5 more
</init>

I dont'know why it is asking for MARIADB, I use postgresql.
It is tiring.
Please how could I correct it ?
Thanks.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
That's a very weird error. It should actually never happen, since the field exists and is unchanged.
https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/dao/db/MariaDBDBFactory.java
https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/dao/db/DBType.java
It could be some kind of classloader issue.
Is this Liferay 7.1?:  C:/Users/tkossoko/liferay-workspace/BMAP-Source/BMAP-source
And this maybe Liferay 7.3: C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client
In any case, I would check for something like that. For me it looks weird that liferay.home points "elsewhere".
Teddy Kossoko, modified 5 Years ago. Junior Member Posts: 42 Join Date: 3/5/18 Recent Posts
yes,
the path " C:/Users/tkossoko/liferay-workspace/BMAP-Source/BMAP-source " is the liferay 7.1 home  and the " C:/Users/tkossoko/Documents/Capgemini/Biomass/portal-tools-db-upgrade-client " is the path of the tool for liferay 7.3. Should I point the conf to my Liferay home ? and not the tool home folder ?
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Yes. liferay.home should point to the 7.3 instance. When you do the upgrade, Liferay basically starts the Liferay server to do the upgrade. I suspect that you get a mixup between 7.1 and 7.3 modules when you configure the upgrader in 7.3 to point to the 7.1 instance.
There was a discussion about upgrade documentation in the blog a while ago:
https://liferay.dev/blogs/-/blogs/liferay-portal-7-3-ce-ga3-release
I wrote a bit of a recipe for upgrading there, maybe it helps.
Teddy Kossoko, modified 5 Years ago. Junior Member Posts: 42 Join Date: 3/5/18 Recent Posts
Thanks for your answer. I started migrating manually all contents and portlets...I know that it is not the most effective solution, but it was the smpliest I found. Thanks.
thumbnail
Alberto Chaparro, modified 4 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Hey Teddy,
Probably the error is caused because of the paths in the app-server.properties, they should be relative to dir, something like this:
dir=C:\Users\tkossoko\Documents\Capgemini\Biomass\liferay-ce-portal-7.3.3-ga4\tomcat-9.0.33
extra.lib.dirs=/bin
global.lib.dir=/lib
portal.dir=/webapps/ROOT
server.detector.server.id=tomcat


Can you try with this configuration?

Cheers!