22 September, 2016

DB Upgrade 6.X to DXP

Image result for Liferay upgradeAs you know Liferay is moved to DXP version now and all existing Liferay customer will migrate or upgrade to newer version of DXP.


Here in these series of  blogs, you will see all step by step guide which will help you to follow all the necessary steps for the migration to DXP.

As a part of migration/up-gradation, Database comes first everywhere which you must require to migrate to make it compatible with new version.

Here we will only talk about migration from 6.X to DXP as we will not consider the older version like 5.X.


 

Required Tools and software :

1) JDK-8 
3) Liferay 6.X Up and running Database
4) Document Library files from 6.X
5) Keep backup of Database as well as data folder of 6.X

Steps to perform for database migration from 6.X to DXP :

 1) If you already have install DXP in local machine then you would have one package called portal-tools-db-upgrade-client available inside \liferay-workspace\bundles\tools\portal-tools-db-upgrade-client path.

2) Open app-server.properties file  and un-comment below entry

dir=../../tomcat-8.0.32
global.lib.dir=lib
portal.dir=webapps/ROOT
server.detector.server.id=tomcat
 

3) Open portal-upgrade-database.properties and un-comment below entry for 6.X DB detail

jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe
jdbc.default.driverClassName=oracle.jdbc.OracleDriver
jdbc.default.username=LIFERAY71
jdbc.default.password=testpassword


4)  Open portal-upgrade-ext.properties.properties and put below property to point Liferay DXP bundle path

liferay.home=C:/Jigs-DXP/liferay-developer-studio/workspace/Jigs_DXP_WS/bundles
 


5) Go to  liferay-workspace\bundles\osgi\configs and create one config file called 

com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.cfg and put below property inside that :
indexReadOnly=true

6) Go to \liferay-workspace\bundles\tools\portal-tools-db-upgrade-client and run below command to execute upgrade process:

java -jar com.liferay.portal.tools.db.upgrade.client.jar -j "-Duser.country=US -Duser.language=en -Duser.timezone=GMT -Xmx4096m"

Note : During above command execution you might get below error for running jar file ,

java.lang.UnsupportedClassVersionError: com/liferay/portal/tools/DBUpgrader : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: com.liferay.portal.tools.DBUpgrader.  Program will exit.
Exception in thread "main"  


This is due to incorrect JDK/JRE being pointed out to  in your system. so just check what have been set into JAVA_HOME path in your machine and make sure that its being point out to correct JAVA version which is JDK8/JRE8 .

You can check all your log inside upgrade.log file.

7) Once above task is execute successfully, you can be able to see success message show below 

 once its done then it would start felix gogo shell which you need to close to start your server.

8) Add below property to portal-ext.properties file before you start your server otherwise it will not allow you to login
passwords.encryption.algorithm.legacy= SHA 

How to Confirm successful DB migration   

Once you get success message for upgrade task, you can go to database and can check release_ table where you can be able to see one entry for servletcontextname=portal and buildnumber=7010 which is your LR DXP version and schema version would be 7.0.10.
This shows that you have migrated your database successfully.


Cheers  and stay tune here how you could be able to convert portlet plugin into module !!!!!!!! 

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...