# Upgrading to Nexus Repository 3.71.0 and Beyond

Nexus Repository 3.70.x release branch are the final releases to support the embedded OrientDB database and Java versions 8 and 11. Before updating to a release after 3.70.x, you must migrate off from the Orient database while upgrading Java. Support for OrientDB is sunsetted and is no longer included in Nexus Repository versions 3.71.0 and beyond.

See [Determining the Current Database](https://help.sonatype.com/en/determining-current-database.html "Determining Current Database")

## Upgrade Paths

The table below provides a brief overview of the upgrade process based on your current database.

| Database | Upgrade Overview |
| --- | --- |
| PostgreSQL | 1. Upgrade to Java 17<br>   <br>2. Follow normal Nexus Repository upgrade procedures |
| H2<br>3.70.x | 1. Upgrade your Java version if necessary. Check [Java Compatibility Matrix](https://help.sonatype.com/en/java-compatibility-matrix.html "Java Runtime Compatibility Matrix") and [Upgrade Java Version](https://help.sonatype.com/en/upgrade-nexus-repository-java-version.html "Upgrade Nexus Repository Java Version")<br>   <br>2. Follow normal Nexus Repository upgrade procedures |
| H2<br>3.69.x or earlier | 1. Upgrade to 3.69.0<br>   <br>2. Export your database with the _Admin - Export SQL database to script_ task<br>   <br>3. Validate the SQL export existence in the database directory<br>   <br>4. Upgrade to Java 17<br>   <br>5. Follow normal Nexus Repository upgrade procedures<br>   <br>**Note**<br>Import of the upgraded H2 database is supported only on versions 3.70.0–3.87.1, and this import must be completed before upgrading beyond that range. |
| OrientDB<br>(for self-hosted to self-hosted) | 1. Upgrade to 3.70.5 version. You must change your database as 3.70.x is the last supported version for OrientDB.<br>   <br>2. If your target instance version is 3.90.2 and above, use Instance Migrator. For other versions, use Database Migrator. See [What to Choose](https://help.sonatype.com/en/what-to-choose---instance-migrator-or-database-migrator.html "What to Choose - Instance Migrator or Database Migrator") page<br>   <br>3. Upgrade the Java version if necessary. Starting with `3.87.0`, Sonatype’s official installers and images include a bundled Java 21 runtime. Check [Upgrade Java Version](https://help.sonatype.com/en/upgrade-nexus-repository-java-version.html "Upgrade Nexus Repository Java Version")<br>   <br>4. Follow normal Nexus Repository upgrade procedures<br>   <br>**Note**<br>Migrating to a PostgreSQL database with version 3.70.x requires a Pro license. Non-pro deployments will need to migrate to H2 on version 3.70.x and can migrate to PostgreSQL after upgrading to Nexus Repository version 3.77.x or later. |
| OrientDB<br>(for self-hosted to Sonatype Cloud) | 1. Upgrade to 3.70.5 version<br>   <br>2. Use Instance Migrator to migrate to a Sonatype Cloud instance. |

## Nexus Repository Deployments Using OrientDB

Nexus Repository 3.70.x is the last release that supports OrientDB.

Sonatype recommends that Nexus Repository Pro deployments migrate from OrientDB to PostgreSQL. For Community Edition deployments, you must first migrate from OrientDB to H2. Community Edition support for migration to PostgreSQL is available only in releases after 3.77.0.

1. #### Upgrade to the Latest Nexus Repository 3.70.x Release

Upgrade to the latest version of 3.70.x using the standard upgrade procedures. Start the instance before proceeding to ensure everything works as expected.

As OrientDB does not support Java 17, continue to use Java 8 or 11 until after the database migration.

See [Final Orient Release Download](https://help.sonatype.com/en/orientdb-downloads.html "Nexus Repository 3.70.x Downloads with OrientDB")

_This includes the migrator version to use for the next step._

2. #### Use one of the following migrator tools that serves your need

- Use Instance Migrator if you are on OrientDB and wish to migrate to a self-hosted instance (3.90.2+), or to Sonatype Cloud. See [Instance Migrator](https://help.sonatype.com/en/instance-migrator.html "Instance Migrator")

- Use Database Migrator when changing the database of a self-hosted instance. See [Migrating to a New Database](https://help.sonatype.com/en/migrating-to-a-new-database.html "Migrating to a New Database")

For a detailed comparison, see [What to Choose - Instance Migrator or Database Migrator](https://help.sonatype.com/en/what-to-choose---instance-migrator-or-database-migrator.html "What to Choose - Instance Migrator or Database Migrator")

**Note**

Consider the following elements while using Database migrator:

- Nexus Repository Pro deployments may switch directly to PostgreSQL. But Community Edition users must use the H2 database until upgrading to a Nexus Repository version beyond the 3.77.0 release. Sonatype recommends using PostgreSQL in production deployments.

- After changing the database, upgrade your Nexus Repository instance to version 3.71.0 or later.
     As part of the upgrade, move to a supported Java version. Nexus Repository 3.71.0 and later does not support Java 8 or Java 11. To change Java versions, download the appropriate Nexus Repository distribution package. Each package includes configuration for its supported Java version. See [Upgrade Nexus Repository Java Version](https://help.sonatype.com/en/upgrade-nexus-repository-java-version.html "Upgrade Nexus Repository Java Version")

## Nexus Repository Deployments Using H2

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.

The internal H2 database used by Nexus Repository was updated in the 3.71.0 release. This upgrade workflow requires exporting the H2 database using a special task available in the 3.69.0 release before upgrading. Support for Java 17 was introduced in the 3.69.0 release and is required for all future releases.

1. #### Upgrade to the Nexus Repository 3.69.0 Release

This step is required to create the files to use during the internal H2 upgrade and is the first supported version of Java 17.

See [Download Archives](https://help.sonatype.com/en/download-archives---repository-manager-3.html#sonatype-nexus-repositorytm-3-69-0-02 "Sonatype Nexus RepositoryTM 3.69.0-02")

2. #### Upgrade to Java 17

The Sonatype team provides alternate distribution binaries and the required `nexus.vmoptions` configuration to align with the supported Java version. You must download the correct distribution to switch to a different java version.

Set the Java path in the `bin/nexus` script. Uncomment and update the `INSTALL4J_JAVA_HOME_OVERRIDE` property. Java is embedded in later distributions of Nexus Repository where this override method is no longer recommended or used.

3. #### Export the H2 database

Changes made in Nexus Repository after exporting the database are not included in the new instance. We recommend limiting access to the repository at this point until the upgrade is complete.

Running the _Admin - Export SQL database to script_ task outputs a file called `nexus-<timestamp>.sql` to the `$data-dir/db` folder. This file is used to migrate the H2 database during the upgrade to the 3.71.0 or later releases.

4. #### Upgrade to Nexus Repository versions 3.70.0–3.87.1

On startup, Nexus Repository uses the latest `nexus-<timestamp>.sql` file and the H2 database file called `nexus.mv.db` files that are found in the `$data-dir/db` folder. Nexus Repository automatically creates a backup called `nexus-<timestamp>-backup.zip`.

This process may take some time depending on the size of the database. Instances with H2 database over 10 gigabits should consider migrating to PostgreSQL. PostgreSQL is available to Community Edition users as of the 3.77.2 release.

**Note**

Import of the upgraded H2 database is supported only on versions 3.70.0–3.87.1, and this import must be completed before upgrading beyond that range.

5. #### Verify the Nexus Repository instance

Once the instance has completely started, verify that the service is working as expected.

6. #### Delete the SQL and backup files

The `nexus-<timestamp>.sql` and `nexus-<timestamp>-backup.zip` files should be removed or deleted from the deployment for security reasons. Do not remove or rename the `nexus.mv.db` file.

## Nexus Repository Deployments Using PostgreSQL

Update your Java version to Java 17 when upgrading to upgrading to versions after the 3.70.0 release following the typical upgrade instructions. The Nexus Repository 3.71.0 release and greater no longer supports Java 8 or 11.

see [How to change your Java Version](https://help.sonatype.com/en/upgrade-nexus-repository-java-version.html "Upgrade Nexus Repository Java Version").
