Default behavior changes to the Database Upgrade Tool

Based on feedback from our users, we have made some changes to the default behavior of the Database Upgrade Tool to improve usability and performance of the upgrade process.

  1. The default maximum heap memory has been doubled from 2048 MB to 4096 MB. The previous default was insufficient for any large upgrades and could cause out-of-memory errors. The new default provides additional headroom and improves upgrade stability.

    1. Custom memory limits can still be set using the --jvm-opts parameter.
    2. Even larger limits may be needed depending on the database size.
  2. Recent DXP versions ship with a simpler tomcat directory name instead of including the version number (such as tomcat-10.1.43). This applies to both bundled Tomcat releases and Docker images. The default in app-server.properties has been updated to match this change. This reduces the need for manual property management when upgrading modern DXP installations.

  3. The interactive setup now validates inputs as they are entered, catching problems before the upgrade starts. Previously, only the application server type and database type were validated, allowing invalid values to proceed until failures occurred later in the process. This approach catches configuration mistakes early instead of allowing them to cause failures during upgrade execution. The following inputs are now validated:

    1. Directory paths: When paths are entered for Liferay home, application server directory, extra libraries, global library, or portal directory, the tool verifies they exist. Invalid paths trigger an error message explaining the issue, and the prompt repeats.
    2. Database host: The tool checks if the database hostname can be resolved via DNS. Resolution failures result in an error message with details.
    3. Database port: Port numbers are validated to ensure they fall within the valid range (0-65535). Invalid ports are rejected immediately with an error.
  4. The tool now reads existing database configuration from portal-ext.properties instead of requiring re-entry. It can still be overridden by portal-upgrade-ext.properties.

  5. Default JVM parameters are automatically applied, in addition to custom parameters from --jvm-opts. The following are applied unless explicitly changed by the user:

    1. -Dfile.encoding=UTF8
    2. -Duser.country=US
    3. -Duser.language=en
    4. -Duser.timezone=GMT
    5. -Xmx4096m
  6. To improve database upgrade performance, database connections are now automatically configured with batch insert optimization parameters, removing the need for manual JDBC URL configuration for the upgrade. User defined parameters are still preserved.

    1. PostgreSQL: Adds reWriteBatchedInserts=true to enable batch insert optimization
    2. MySQL/MariaDB: Adds rewriteBatchedStatements=true to enable batch statement rewriting
    3. SQL Server: Adds useBulkCopyForBatchInsert=true to enable bulk copy for batch operation
  7. The upgrade tool now uses a single configuration file for all upgrade settings. All properties are set from portal-upgrade-ext.properties. The portal-upgrade-database.properties is now deprecated and ignored.

  8. The default application server directory paths in both the app-server.properties template have been updated to use explicit relative path notation to reduce confusion about the upgrade file paths.

    1. /bin → ./bin
    2. /lib → ./lib
    3. /webapps/ROOT → ./webapps/ROOT
    4. /WEB-INF/... → ./WEB-INF/...
  9. The upgrade tool’s interactive wizard now uses PostgreSQL as the default database. This change reflects PostgreSQL’s widespread adoption and recommended usage for Liferay DXP. Users can still select any supported database by entering a different value at the prompt.