Skip to main content

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

Nexus Repository versions from 3.70.0 and beyond require a version 2.x H2 database; previous Nexus Repository versions used a version 1.x database. Therefore, you will need to run a task to export your H2 v1.x database before upgrading Nexus Repository. Sonatype added this task in version 3.69.0, so you must be on 3.69.0 before proceeding. The sections below will walk you through this process.

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.

The sections below will walk you through the process.

H2_369_Java811

Phase 1 - Export your H2 Database from your 3.69.x Instance

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 Sonatype Nexus Repository:

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

  2. 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 your Java and Nexus Repository versions.

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.