- Prerequisites:
- Download Liferay 7.1 ga2 zip portal and upload it to the liferay server
- Backup of Liferay portal(6.1) database.
- Download and install liferay 7.1 ga2:
-
Download liferay portal on the linux server from: https://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.1.1%20GA2/liferay-ce-portal-tomcat-7.1.1-ga2-20181112144637000.tar.gz
Command :
$ sudo wget https://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.1.1%20GA2/liferay-ce-portal-tomcat-7.1.1-ga2-20181112144637000.tar.gz -
Create liferay user:
$ sudo useradd liferay -
Create the liferay folder and associate it to liferay user:
$ cd /opt/ $ sudo mkdir liferay $ sudo chown -R liferay:liferay liferay -
Copy the zip portal to Liferay folder:
$ sudo cp /[location_zip]/ liferay-ce-portal-tomcat-7.1.1-ga2-20181112144637000.tar.gz /opt/liferay -
Extract liferay portal and change the owner:
$ sudo tar xvzf liferay-ce-portal-tomcat-7.1.1-ga2-20181112144637000.tar.gz $ sudo chown -R liferay:liferay liferay-ce-portal-tomcat-7.1.1-ga2 -
Create a liferay service:
# Liferay NAS Symposium Boston 2014 auto-start # ### BEGIN INIT INFO # Provides: liferay # Required-Start: $apache2 $mysql # Required-Stop: $apache2 # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # X-Interactive: true # Short-Description: Start/stop tomcat server bundled with liferay ### END INIT INFO #export JAVA_HOME=/usr/lib/jvm/default-java # If Liferay has ever been started (or unzipped) with a different user # account than what it's running as, we need to correct permissions. # # cd /opt/liferay # chown -R liferay data deploy # cd tomcat # chown -R liferay webapps conf temp logs work # cd /opt/liferay/tomcat # run on hardened permissions by default # chown -R root webapps conf ../deploy cd /opt/liferay/liferay-portal-7.1.1-ga2/ case $1 in start) # run on softened permissions by default: might need to deploy hooks etc. on startup chown -R liferay tomcat-9.0.10/temp tomcat-9.0.10/logs tomcat-9.0.10/work tomcat-9.0.10/webapps tomcat-9.0.10/conf deploy sudo -u liferay /opt/liferay/liferay-portal-7.1.1-ga2/tomcat-9.0.10/bin/startup.sh ;; stop) sudo -u liferay /opt/liferay/liferay-portal-7.1.1-ga2/tomcat-9.0.10/bin/shutdown.sh ;; soften) # can and should be run when the server is running. chown -R liferay webapps conf ../deploy ;; harden) # can and should be run while the server is running. chown -R liferay webapps conf ../deploy ;; harden) # can and should be run while the server is running. chown -R root tomcat-9.0.10/webapps tomcat-9.0.10/conf deploy ;; restart) sudo -u liferay /opt/liferay/liferay-portal-7.1.1-ga2/tomcat-9.0.10/bin/shutdown.sh sleep 5 sudo -u liferay /opt/liferay/liferay-portal-7.1.1-ga2/tomcat-9.0.10/bin/startup.sh ;; esac exit 0This code need to be inserted in a file named liferay and added to /etc/init.d/ folder with root permission. -
Run the liferay service:
$ sudo service liferay start -
Show the log file:
$ cd /opt/liferay/ liferay-portal-7.1.1-ga2/tomcat-9.0.10/log/ $ sudo tail -f catalina.out -
Intall liferay 7.1 ga2 with the default configuration:
- Install backup databases: In this step we will be installing the portal liferay 6.1 database on the appropriate server and migrating it to the version 7.1 liferay ga2.
- Steps to perform for database migration from 6.1 to 7:
- If you already have installed 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.
-
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 -
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 -
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 -
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 -
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" -
Once above task is execute successfully, you can be able to see success message show below
Once it’s done then it would start felix gogo shell which you need to close to start your server.
-
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 - Run Liferay 7.1 portal with the migrated database: This step consists of changing the connection settings in the liferay 7.1 properties file.
-
Stop the liferay 7.1 server:
$ sudo service liferay stop -
Update the properties file:
jdbc.default.driverClassName=org.postgresql.Driver jdbc.default.password=***** jdbc.default.url=jdbc:postgresql://localhost:5432/ecommerce_lr7_1 jdbc.default.username=postgres -
Start the server:
$ sudo service liferay start -
Show the log file:
$ cd /opt/liferay/ liferay-portal-7.1.1-ga2/tomcat-9.0.10/log/ $ sudo tail -f catalina.out - Upgrade theme, all portlets and all plugins: We need to upgrade the theme to new version of the liferay. Upgrade all the plugins and portlets to the osgi modules supported by the liferay 7.1 ga2 Install all modules and the theme on the new portal. --> We need to check the LDAP plugin between the portal and the website since we have the same liferay version.
- References:
To upgrade to the latest release directly, you must be coming from Liferay Portal 6.0.12 or higher.
If you’re on Liferay Portal 6.0.11 or below, you should upgrade to Liferay Portal 6.2 before approaching an upgrade to the Liferay Portal CE 7.0 platform.
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.
This shows that you have migrated your database successfully.



0 comments: