Database Upgrade Tool Reference

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

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




The absolute path of the application server folder.


A comma-delimited list of extra directories containing any binaries or resources to add to the class path.

Use paths relative to dir.


The application server’s global library directory.

Use a path relative to 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.

  • When using upgrade.log.context.enabled, set a name for the identifier. For example,

Note, upgrade.log.context.enabled works for both the upgrade tool as well as upgrades upon startup. To use this feature, you must also 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" />

Here are some example log lines that include a tag for upgrade related-lines:

2022-07-26 20:56:15.966 INFO  [main][PortalUpgradeProcess:174] Upgrading com.liferay.portal.upgrade.PortalUpgradeProcess {foo=foo}
2022-07-26 20:56:15.969 INFO  [main][UpgradeProcess:98] Upgrading com.liferay.portal.upgrade.v7_4_x.UpgradeAddress {foo=foo}
2022-07-26 20:56:18.765 INFO  [main][UpgradeProcess:113] Completed upgrade process com.liferay.portal.upgrade.v7_4_x.UpgradeAddress in 2797 ms {foo=foo}
2022-07-26 20:56:38.611 INFO  [main][BaseDB:716] Dropping stale indexes {foo=foo}
2022-07-26 20:56:38.615 INFO  [main][BaseDB:786] drop index IX_60C8634C on Repository {foo=foo}

Example Upgrade Configurations

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