Database Upgrade Tool Reference

Database Upgrade Tool Reference


As of Liferay 7.4 U82/GA82 and above, the file has been renamed to

Here’s an overview of Liferay’s upgrade tool.

Start the upgrade tool using the script in the [LIFERAY_HOME]/tools/portal-tools-db-upgrade-client folder (db_upgrade_client.bat on Windows).


Database Upgrade Tool Usage

This command prints the upgrade tool usage: --help

Here are all the upgrade tool command line options:

–help or -h: Prints the tool’s help message.

–jvm-opts or -j + [arg]: Sets any JVM options for the upgrade process.

–log-file or -l + [arg]: Specifies the tool’s log file name—the default name is upgrade.log.

–shell or -s: Automatically connects you to the Gogo shell after finishing the upgrade process.

Logging Output

The -l option specifies the tool’s log file name: -l "output.log"

Make sure to set the file encoding to UTF-8 and the time zone to GMT. Since the database upgrade tool operates on your DXP database, you should also configure the upgrade tool with the same JVM options that you use for your DXP application server. If you used country and language JVM options, specify them for the upgrade tool.

While you’re at it, allocate the initial memory (-Xmx value) for the upgrade tool too. Use 2 GB at a minimum. If your DXP database has over 10 GB of data, increase the initial memory.

Using a test scenario with a 3.2 GB database and a 15 GB Document Library, the following Java process settings were optimal:

  • Xmx 8 GB RAM
  • File encoding UTF-8
  • User time zone GMT

Here is the command corresponding to these settings: -j "-Xmx8000m -Dfile.encoding=UTF-8 -Duser.timezone=GMT"

Configuring the Upgrade Tool

The core upgrade requires configuration. The simplest way is to use the upgrade tool to create your configuration files on the fly. Here’s an example interaction with the upgrade tool’s command line interface:

Please enter your application server (tomcat):

Please enter your application server directory (../../tomcat-9.0.17):

Please enter your extra library directories (../../tomcat-9.0.17/bin):

Please enter your global library directory (../../tomcat-9.0.17/lib):

Please enter your portal directory (../../tomcat-9.0.17/webapps/ROOT):

[ db2 mariadb mysql oracle postgresql sqlserver sybase ]
Please enter your database (mysql):

Please enter your database host (localhost):


Omitted values use the defaults displayed in the parentheses.

Manual Configuration

You can also pre-configure the upgrade tool to set more values than the tool generates. Use these files in [LIFERAY_HOME]/tools/portal-tools-db-upgrade-client/ to manually configure the core upgrade:

  • Specifies the server location and libraries.
  • Configures the database connection.
  • Sets the rest of the portal properties that the upgrade requires. To replicate your current DXP server, you can copy your current portal properties (except your database properties) into this file. Before using your current properties, make sure to update them for the current DXP version.


Specify the following information to configure DXP’s application server:

Property Name Meaning Notes
dir The absolute path of the application server folder.
extra.lib.dirs A comma-delimited list of extra directories containing any binaries or resources to add to the class path. Use paths relative to dir.
global.lib.dir The application server’s global library directory. Use a path relative to dir.
portal.dir The directory where portal is installed in your application server. Use a path relative to dir. The ID of a supported application server. Supported IDs: jboss, jonas, resin, tomcat, weblogic, websphere, wildfly

Relative paths must use Unix style format (forward slashes) and start with a /. For example, the following properties are for Windows:


As another example, the following properties are for Linux:



Specify the following information to configure the database you’re upgrading. Note that these properties correspond to the JDBC portal properties you’d use in a file.

  • jdbc.default.driverClassName
  • jdbc.default.url
  • jdbc.default.username
  • jdbc.default.password

See the latest portal properties reference for a reference on these values.


Add all portal properties, such as file properties, from your backup. The following properties are especially important to configure the upgrade:

  • liferay.home: The LIFERAY_HOME folder.

  • The implementation for persisting documents to the document library store. This property is only mandatory if you’re using a *FileSystemStore implementation. If you updated this property in your, copy the new value here. Otherwise, set the property one of these ways:
  • hibernate.jdbc.batch_size: The JDBC batch size used to improve performance (set to 250 by default). This property may improve upgrade performance, but it is not required.

  • upgrade.log.context.enabled: Set to true to see upgrade-related log lines that are tagged with an identifier. The possible identifiers are

    • {upgrade.component=portal}: for upgrade processes related to portal
    • {upgrade.component=framework}: for processes related to the upgrade framework logic
    • {upgrade.component=<bundleSymbolicName>}: for upgrade processes related to modules

To use this feature, you must copy the portal-impl/src/META-INF/portal-log4j.xml file into bundles/tomcat/webapps/ROOT/WEB-INF/classes/META-INF and rename the file to portal-log4j-ext.xml. Then find the appender definition:

<Appender name="CONSOLE" type="Console">
	<Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m%n" type="PatternLayout" />

Change the definition to include %X, which tells Log4j to print the thread context information:

<Appender name="CONSOLE" type="Console">
	<Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m %X%n" type="PatternLayout" />

See upgrade log context for more information.

Example Upgrade Configurations

Here are example upgrade configuration files that you can customize and copy into [LIFERAY_HOME]/tools/portal-tools-db-upgrade-client/: