Skip to main content

Upgrading to 3.71.0+ for Instances Using H2, a Pre-3.69.0 Nexus Repository Version, and Java 8 or 11

Nexus Repository versions 3.70.0 and above require that your H2 database be on version 2.x; earlier Nexus Repository versions used H2 version 1.x. In release 3.69.0, we added a task to help you upgrade your H2 database. Therefore, you will need to upgrade to 3.69.0 before you can continue beyond that version.

Nexus Repository version 3.71.0 and above also require Java 17, so you will need to upgrade your Java version before you can upgrade to 3.71.0.

H2_Pre368_Java811.png

The sections below will walk you through the process.

Phase 1 - Upgrade to 3.69.x and Export Database

Upgrading your H2 database involves generating an export of that database; should any changes continue to be made in your Nexus Repository instance after generating this export, those changes will be lost and not included in the exported file. To minimize any potential for lost information during the upgrade period, complete the following prerequisite steps immediately before upgrading to Sonatype Nexus Repository 3.70.0+:

  1. Upgrade to Sonatype Nexus Repository version 3.69.0.

    1. Installation and Upgrades

    2. Upgrading a Standalone Instance

  2. In version 3.69.0, create and run the Admin - Export SQL database to script task.

  3. Check the $data-dir/db folder for the file that the task created; it will have a name like "nexus-<timestamp>.sql."

You can now continue to upgrade to 3.71.0 while also upgrading to Java 17.

Phase 2 - Upgrade Your H2 Database, Java Version, and Nexus Repository Instance

Since Nexus Repository 3.71.0+ requires Java 17, you will need to change your Java version while upgrading your Nexus Repository instance. If you are unsure how to do this, refer to our documentation on how to change your Java version. Otherwise, your upgrade follows normal upgrade procedures with the following additional steps to upgrade your H2 database:

  1. Before starting your upgraded Nexus Repository instance, ensure the $data-dir/db folder contains the previously built nexus-<timestamp>.sql file and the H2 database file called "nexus.mv.db." Do not remove or rename the nexus.mv.db file.

  2. Start your Sonatype Nexus Repository instance.

  3. Sonatype Nexus Repository will now perform the H2 upgrade.

    1. As part of the upgrade process, Nexus Repository will create a backup of the H2 v1.4.200 database in the $data-dir/db folder should you need it for rollback purposes. This file will be called nexus-<timestamp>-backup.zip.

    2. Note that if multiple nexus-<timestamp>.sql files exist in the $data-dir/db folder, Nexus Repository will use the file with the most recent timestamp to create the H2 v2.2.224 database.

  4. Verify that Nexus Repository started correctly with all expected repository information.

  5. You can now delete the SQL and backup files.