Skip to main content

Upgrading to 3.71.0+ for Instances Using H2, Nexus Repository 3.69.0, and Java 17

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.

H2_369_java17.png

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 Nexus Repository version.

Phase 2 - Upgrade Your Nexus Repository Instance and H2 Database

  1. Follow normal upgrade procedures to upgrade Nexus Repository to 3.71.0.

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

  3. Start your Sonatype Nexus Repository instance.

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

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

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