You can upgrade a Liferay DXP 7.0 theme to the new DXP version, regardless of the
development environment you use. This tutorial uses the Liferay JS Theme
Toolkit’s Gulp upgrade
task to automate much of the steps. The Gulp upgrade
task must be run twice to bring a Liferay DXP 7.0 theme up to the new DXP version.
The Liferay Theme Generator is available in a few different versions. To update
the Liferay DXP 7.0 theme to Liferay DXP 7.1, you must install v8.x.x of the
liferay-theme-tasks
dependency. After the theme is updated to 7.1, you must
then install v9.x.x of the liferay-theme-tasks
dependency to complete the
upgrade process.
Here’s what the Upgrade Task does:
Follow these steps to take the theme through the upgrade process:
Navigate to the theme’s root directory and run the command below to update
the theme’s liferay-theme-tasks
dependency to version 8.x.x
:
npm install --save-dev liferay-theme-tasks@8.x.x
Run the gulp upgrade
command to upgrade the Liferay DXP 7.0 theme to 7.1.
Here’s what it does:
You must update the theme’s liferay-theme-tasks
dependency to version
9.x.x
to complete the upgrade process. Install the latest version of the
Liferay Theme Generator as well while you’re at it, so future uses of the
tool will be compatible with the the new DXP version theme. Both commands are
shown below. Run them separately:
npm install --save-dev liferay-theme-tasks@9.x.x
npm install -g generator-liferay-theme@9.x.x
With the 9.x.x
versions of the liferay-theme-tasks
and Liferay Theme
Generator installed, run the gulp upgrade
command for the final time to
upgrade the 7.1 theme to 7.2:
Here’s what it does:
Run gulp init
from your theme’s root directory to update the path of your
Liferay DXP server to point to your 7.2 Liferay DXP server.
The Gulp upgrade
task lists any deprecated or removed variables. For other
areas of the code it suspects might need updates, it logs suggestions. The task
also reports changes that may affect theme templates. This jump-starts the
upgrade process, but it doesn’t complete it. Manual updates are required. The
remaining portion of this tutorial covers these manual steps.