Upgrading to Liferay DXP 7.0 involves migrating your installation and code (your custom apps) to the new version. You’ll learn how to upgrade your code in this section.
The first upgrade process step is to adapt your existing plugin’s code to Liferay DXP 7.0’s APIs. The great news is that Liferay’s Upgrade Planner makes this easier than ever. It identifies Liferay API changes affecting your code, explains the API changes, and offers resolution steps. And the tool offers auto-correction where it can.
You might be tempted to optimize your existing plugins right away to benefit from the new things Liferay DXP offers, but you shouldn’t. It’s much better to upgrade your plugins according to these tutorials. In this way, you’ll get your plugins running in Liferay as fast as possible, and at the same time you’ll have prepared the plugins for the optimizations you can implement later.
These tutorials assume you’re using the Liferay Upgrade Planner. To follow along with this section, install the planner and step through the upgrade instructions.
For convenience, this tutorial section also references documentation and outlined steps to aid those opting to upgrade their code manually.
Here are the code upgrade steps:
-
Upgrade Your Development Environment
Legacy project environments should be upgraded to the latest version of Liferay Workspace to ensure you leverage all available features.
-
A Liferay Workspace is a generated environment that is built to hold and manage your Liferay projects. Create/import a workspace to get started.
-
If you don’t have an existing 7.x Liferay Workspace, you must create one. Skip to the next step if you have an existing workspace.
-
Import Existing Liferay Workspace
Import an existing Liferay Workspace. If you don’t have one, revisit the previous step.
-
-
Configure Liferay Workspace Settings
Set the Liferay DXP version in workspace’s configuration you intend to upgrade to.
-
Configure your bundle URL that the Liferay DXP bundle is downloaded from.
-
Configure Target Platform Version
Configure your Target Platform version, which provides the specific artifacts associated with a Liferay DXP release.
-
Download the Liferay DXP bundle you’re upgrading to.
-
-
-
Copy your Plugins SDK projects into workspace and convert them to Gradle/Maven projects.
-
Import Existing Plugins SDK Projects
Import your existing Plugins SDK projects.
-
Migrate Existing Plugins to Workspace
Migrate your existing plugins to workspace. This involves moving the plugin to workspace and converting it to the workspace’s build environment.
-
-
Optimize your workspace’s build environment for the most efficient code upgrade experience.
-
Update your repository URL to Liferay’s frequently updated CDN repository.
-
Update Workspace Plugin Version
Update your Workspace plugin version to leverage the latest features of Liferay Workspace.
-
Remove the project’s dependency versions since it’s leveraging target platform.
-
-
Fix common upgrade problems dealing with your project’s dependencies and breaking changes.
-
Auto-correct straightforward upgrade problems.
-
Find upgrade problems. These are problems that cannot be auto-corrected; you can update them manually according to the breaking changes documentation.
-
Mark upgrade problems as resolved after addressing them.
-
After fixing your upgrade problems, remove the problem markers.
-
-
Upgrade your customization plugins so they’re deployable to Liferay DXP 7.0.
-
Upgrade your themes so they’re deployable to Liferay DXP 7.0.
-
Upgrade your layout templates so they’re deployable to Liferay DXP 7.0.
-
-
Upgrade JNDI Data Source Usage
Use Liferay DXP’s class loader to access the app server’s JNDI API.
-
Upgrade Service Builder Service Invocation
For Service Builder logic remaining in a WAR, you must implement a service tracker to call services. For logic divided into OSGi modules, you can leverage Declarative Services.
-
Adapt your app to account for Service Builder-specific changes.
-
Migrate Off of Velocity Templates
Velocity template usage is deprecated for Liferay DXP 7.0. You should convert your template to FreeMarker.
-
-
Upgrade your portlets so they’re deployable to Liferay DXP 7.0.
-
Upgrade web plugins previously stored in the
webs
folder of your legacy Plugins SDK. -
Attempt to leverage an extension point instead of upgrading your Ext plugin. If an Ext plugin is necessary, you must review all changes between the previous Liferay Portal instance you were using and Liferay DXP 7.0, and then manually modify your Ext plugin to merge your changes with Liferay DXP’s.
Once you’ve finished the code upgrade steps, your custom apps will be compatible with Liferay DXP 7.0!