Migrating from Liferay 6.x to Liferay DXP

Liferay Digital Experience Platform (DXP) gives you a full view of the customer in order to create and manage consistent customer experiences across mobile, social, desktop, in store and other touch based devices. DXP prepares you to adapt quickly to future digital innovations.

Liferay DXP adopted new architecture with latest features in the web technologies. Due to architectural changes there will be many challenges while migrating to latest Liferay DXP from Liferay 6.x.

Top 5 things you should consider while migrating to Liferay DXP:

1. Backup existing data

Backup of existing data is must before doing any migration. The first thing is to take proper backup from the current running server. The backup will help you revert back to older state, if anything doesn’t work properly.

Backup needs to be taken for the items listed below.

  • Database schema
  • Files from data folder (which contain document and media files)
  • Custom configurations in the properties files. (portal-ext.properties)
  • Portal Preferences that are associated with portlets.

Note: In Liferay DXP, PortalPreferences_ has been removed and replaced by a modular OSGi-based configuration framework.

2. Database upgrade

Once the database backup is done, we need to upgrade the database with respect to Liferay DXP. Database comes first everywhere which you must require to migrate to make it compatible with the new version.

Process of doing database upgrade are as follows:

  • Disable indexing so that indexer doesn’t try to run during the upgrade.
  • Add the below .cfg file in following server path – [Liferay Home]/osgi/configs com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.cfg with following content :- indexReadOnly=true.

Note: By adding the above file, you will avoid indexing and save time during the upgrade process. Once you have upgraded your portal, remove that property or set it to false so that you can index all objects from control panel.

Make sure all your database indexes have been applied correctly. A missing index can cause an upgrade to really slow down.

3. Upgrade to Java 8

Liferay DXP comes with Java 8 as default Java Runtime.

Java 8 is quite mature at this point, and brings a multitude of new features that improve the quality of life of Java developers significantly, in terms of both overall performance and maintainability. While applications written for Java 7 can be run on Java 8 (in most cases), it is recommended to budget time into your migration plan to allow each of your applications to be ported and validated using Java 8.

4. Change in Deployment Process

Since Liferay architecture of Liferay DXP has changed, it has adopted OSGi framework container which is based on modules based application. Due to OSGi container the deployment process has been changed based on different approaches.

Deployment process with different approaches.

  • WARs are traditional web apps to which we are all accustomed. WARs are not recommended in Liferay DXP because you lose access to any service that has been deployed to the OSGi container, though they can still access Liferay’s core services.
  • Bundles/Modules are plugins you’ve converted to an OSGi bundle. They are just simple Java JARs with OSGi metadata. Bundles can only be deployed into the OSGi container. Bundles cannot access services deployed as WARs besides Liferay’s core services. This is the recommended approach for all new development and will be the approach Liferay takes for all new development.
  • WABs are web archive bundles. If you deploy a WAR to the OSGi container, Liferay will convert the WAR into a WAB. This will give you all the benefits of a bundle without doing the conversion. This is the recommended approach for deploying legacy applications built for older versions of Liferay.

The Liferay auto deploy directory now deploys to the OSGi container by default. The only way to deploy to your web application’s deploy folder is to do this manually through a direct deploy.

Many of our tools will directly deploy to the OSGi container.

Note: If you plan to cluster your servers, OSGi bundles may provide an additional hurdle if you rely on your app server’s administrative tools to do cluster deployment as those tools are not able to deploy to our OSGi container. As a current workaround, Liferay provide with Cluster Deployment Helper. This tool will take any number of files and bundle them into a WAR. The WAR will copy the files into Liferay’s deploy folder when it is deployed and then uninstall itself. You can then use the WAR with any app server administration tool.

5. Search

Liferay DXP comes with Solr and embedded Elasticsearch search engine. Elasticsearch will not be supported for production server. There is a choice Elasticsearch (non-embedded) or Slor as your search provider.

Basically, you will be require separate search server to maintain the whole Liferay portal to work smoothly.