Liferay Upgrade from 6.2 to Liferay DXP 7.X

Liferay launched its Digital Experience Platform (DXP) to facilitate businesses to upgrade the creation and management of experiences that aids the end-to-end customer relationship. Migration to the Liferay Digital Experience Platform (DXP) is one of the most significant moves a business can make when switching from legacy technology. Before starting the upgrade/migration, it’s crucial we make the whole plan for migration. Following the migration, topics are felt in these categories

When mingled with the novel characteristics of modern digital business where customers can have more conversations than ever with companies of their choice, the lack of a supporting platform can be the difference between net new customers or a loss of competitiveness.

1. Prerequisite for migration

Before upgrading to Liferay, make sure you first take care of the following point

1. Make sure that Liferay is patched with the most recent service pack.
2. Create a test environment and use copies of the database and server.
3. Clean unnecessary database data to improve portal performance and make the migration process faster. For pruning, the database perform the following task

a. Removing Duplicate Web Content Structure Field names. Liferay has provided Groovy scripts, i.e., https://portal.liferay.dev/documents/113763090/114000078/NormalizeDuplicateFields-6.2.x.groovy you can run in the script console.
b. Removing Unused Objects

i. Data cleanup – In the Control Panel, navigate to System Settings → Upgrades (in the Platform category) → Data Cleanup. Select the module and execute Data clean up.
ii. Specific objects must be checked, and unused must be removed following are the object types.

1. Instance: Remove unwanted instances as they consume the highest objects in the hierarchy.
2. Sites: Remove an unwanted site. The objects associated with the site will also get removed.
3. Removing Intermediate Journal Article & Documents Versions: when we make any modifications to a journal article, it is saved as a version. We can safely remove old versions of a journal article, and documents that are not required it will free significant space.
4. Users -Remove all inactive users, and it’s related data to optimize the process.
5. Layouts: As layouts associated with pages
6. Unwanted Data: Remove unwanted data like preference, documents, Resource permission, etc.

4. Testing the copy of the database after pruning data.

2. Database migration

In this step, we will migrate our database from Liferay 6.2 to Liferay 7.x

1. As many update statements will be executed during migration, we must tune the database before migration. The following are steps to tune the database.

a. Deactivate the data integrity measure taken by databases as it impacts the performance.
b. Turn off transaction logging as it is not required during upgradation.
c. Increase the interval to flush commits to disk

2. Liferay provides a data migration tool for seamlessly migrating the database using simple steps.
3. For Oracle and postgres Database, add db connector jar file into {liferay.home}/tomcat-9.0.6/lib/ext folder.
4. Before starting the database upgrade process, Create com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config file and add indexReadOnly property in com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config file is set to true. (indexReadOnly=”true”)

3. Liferay Code Migration

1. Once the database is migrated you need to upgrade the code to make it compatible with Liferay.
2. Liferay provides a code migration tool in Liferay IDE. You can migrate the code using this tool by following simple steps.

a. Setup Liferay Workspace – Create a Liferay 7.x workspace if you don’t have otherwise import the workspace
b. Liferay Workspace Setting – Download the Liferay 7.x bundle you are upgrading to and convert .cfg files to .config files as they allow specifying a property value’s type and allow multi-valued properties.
c. Fix your upgrade problems:

i. Auto correct your upgrade problems as mention in upgrade tool.
ii. These are some problems that cannot be auto corrected you have to update them manually according to the breaking changes documentation.
iii. Mark your addressed problem resolved and remove the problem marker
iv. Upgrade Service builder and rebuild services to persist update.
v. Upgrade customizes plugins like a hook, fragment, Model Listener, etc.
vi. Upgrade theme, Layout, and templates
vii. Upgrade Ext plugins

3. For JSP hook migration, you need to create a hook module from scratch and override the required jsp.

4. Post Migration Steps

1. Post successful database upgrade change indexReadOnly=”false” in com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config. Otherwise indexing will won’t work.
2. Regenerate the search index
3. If you are using Liferay DXP, then delete the license folder from {liferay. Home}/data directory.
4. Tune your Liferay server by increasing memory in the setenv.bat/setenv.sh file.
5. Now start the Liferay server and copy the license file to the deploy folder if you are using the Liferay DXP.

5. Common issues/error Occurred after Migration

1. You must first upgrade to Liferay Portal 7XXXX – This error will be shown in logs when you start the Liferay DXP/CE server with a Liferay 6.2 database before the upgrade
2. NullPointerException at ThemeServicePreAction – When you had started the migrated server but the migrated theme is not found at that time, this exception will be seen in logs.
3. PwdEncryptorException: invalid keyLength value – This exception will occur when the specified password-encryption algorithm is incorrect. We need to specify the correct encryption algorithm in portal-ext.properties i.e passwords.encryption.algorithm.legacy=.
4. NullPointerException while upgrading DDM – When there is any orphaned template is there, and you run migration at that time, this exception will occur. To resolve this issue, delete the orphaned template.

As we have seen, it is not difficult to migrate to Liferay we just need to make proper migration plans and execution steps according to our portal.

We facilitate businesses to migrate from propriety legacy, expensive, and inefficient systems with Liferay Portal Migration Services with high-security and minimal downtime. We facilitate up-gradation and migration, leveraging an automated migration toolkit. With our domain expertise, we understand how to assess and document existing processes, dependencies comprehensively, and issues when carrying-out migration plans.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to more