blog_Liferay 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 aid 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 Liferay upgrade/migration, it’s crucial we make a comprehensive plan. Following the migration, topics are categorized as follows:

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.

liferay_upgrade_from_6.2_to_liferay_dxp_7.x

1. Prerequisite for Migration

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

  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 tasks:

    • Removing Duplicate Web Content Structure Field names. Liferay has provided Groovy scripts, i.e., NormalizeDuplicateFields-6.2.x.groovy you can run in the script console.

    • Removing Unused Objects

      • Data cleanup – In the Control Panel, navigate to System Settings → Upgrades (in the Platform category) → Data Cleanup. Select the module and execute Data cleanup.

      • Specific objects must be checked, and unused must be removed. The following are the object types:

        • Instance: Remove unwanted instances as they consume the highest objects in the hierarchy.

        • Sites: Remove unwanted sites. The objects associated with the site will also get removed.

        • 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 journal articles and documents that are not required, freeing significant space.

        • Users: Remove all inactive users and their related data to optimize the process.

        • Layouts: Remove layouts associated with unused pages.

        • Unwanted Data: Remove unwanted data like preferences, documents, resource permissions, 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:

  • Deactivate the data integrity measures taken by databases as they impact performance.
    • Turn off transaction logging as it is not required during the upgrade.

  • Increase the interval to flush commits to disk.

  1. Liferay provides a data migration tool for seamlessly migrating the database using simple steps.

  2. For Oracle and PostgreSQL databases, add the DB connector jar file into {liferay.home}/tomcat-9.0.6/lib/ext folder.

  3. Before starting the database upgrade process, create a com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config file and set the indexReadOnly property 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:

    • Setup Liferay Workspace – Create a Liferay 7.x workspace if you don’t have one, otherwise import the workspace.

    • 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.

    • Fix your upgrade problems:

      • Auto-correct your upgrade problems as mentioned in the upgrade tool.

      • Some problems cannot be auto-corrected and must be updated manually according to the breaking changes documentation.

      • Mark your addressed problems as resolved and remove the problem marker.

      • Upgrade Service Builder and rebuild services to persist updates.

      • Upgrade customized plugins like hooks, fragments, Model Listeners, etc.

      • Upgrade themes, layouts, and templates.

      • Upgrade Ext plugins.

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

4. Post Migration Steps

  1. Post successful database upgrade, change indexReadOnly=”false” in com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config. Otherwise, indexing will not work.

  2. Regenerate the search index.

  3. If you are using Liferay DXP, 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. Start the Liferay server and copy the license file to the deploy folder if you are using Liferay DXP.

5. Common Issues/Errors 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 start the migrated server but the migrated theme is not found, 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 and you run migration, 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 proprietary legacy, expensive, and inefficient systems with Liferay Portal Migration Services with high security and minimal downtime. We facilitate upgrades 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.