Nexus Repository 3.x is the latest Repository Manager from Nexus which supports multiple package managers. Due to the vulnerability in Nexus 2 and lack of support for different packages (i.e. NPM, NuGet, Maven, etc.) Nexus 2.X must be migrated to Nexus 3.X which supports multiple package managers.

Upgrade process and explanation:
While the upgrade process is underway, you can continue to use the source Nexus Repository Manager 2. Any repository content that’s added, updated, or deleted is picked up by the upgrade and added to the target Nexus Repository Manager 3 — however, configuration changes are not. Thus, you should not make changes to items such as realm settings, permissions, roles, role assignments, HTTP configuration, SSL certificates, or add new repositories. These types of configuration changes are not considered for an ongoing upgrade and can cause the upgrade process to fail.

What Is Upgraded?
As mentioned, Nexus Repository Manager 3 represents an application design shift, involving a new architecture that supports advanced features for today’s development practices. As such, a few core changes to data stored occur as part of the upgrade process. This includes:

Component storage format from files to blobs:
Components in Nexus Repository Manager 2 are stored as individual files on disk. Version 3 stores components as blobs. The conversion process requires version 3 to iterate over every component stored in version 2. This takes the bulk of the time required for the upgrade process.

Settings and metadata:
Settings and some component metadata in Nexus Repository Manager 2 are stored across many files. Conversely, Nexus Repository Manager 3 loads equivalent data into an OrientDB database.

By default, Nexus Repository Manager 2 uses a different URL pattern to expose repositories and repository groups than Nexus Repository Manager 3. A capability is added during upgrade to allow your automated tools and CI to use the old patterns.

Upgrade Procedures:

  1.  Starting the Upgrade
  2.  Enabling the Upgrade Capability in Version 2.x
  3.  Enabling the Upgrade Capability in Version 3.x
  4.  Running the Upgrade
  5.  After the Upgrade
  6.  Configuring Legacy URL Paths

1. Starting the Upgrade:
Install the Nexus Repository Manager 3. Enable the upgrade capabilities in both version 2 and version 3.

2. Enabling the Upgrade Capability in Version 2.x:
In version 2, enable the Upgrade: Agent capability to open the connection for the upgrade-agent.

Follow these steps:
– Click to expand Administration in the left-hand panel.
– Click the Capabilities menu item to open the respective screen.
– Click the New button to access the Create new capability modal.
– Select Upgrade: Agent as your capability Type.
– Click Add to close the modal and add the capability.
– Copy and save the Access Token found on the Status tab for your new capability. You need it to configure the Upgrade tool in version 3.

In the lower section of the Capabilities interface, the repository manager acknowledges the upgrade-agent as Active.

Screenshots to perform the above steps are as below: (If Screenshot is small to View then u can view in a new tab by selecting open image in new tab)

Step 1: Login as Admin in Nexus2.x

Step 2: Click on Administration and select Capabilities

Nexus Repository Manager1

Nexus Repository Manager2

Step 3: Click on Add a New Capability then select Upgrade: Agent and click on ADD

Nexus Repository Manager3

Nexus Repository Manager4

Nexus Repository Manager5

Step 4: Upgrade: Agent successfully added as below

Nexus Repository Manager6

Step 5: Copy the URL and Access token

Nexus Repository Manager7

3. Enabling the Upgrade Capability in Version 3.x:
In version 3, enable the Upgrade capability to open the connection for the upgrade-agent and access the Upgrade tool.

Follow these steps:
– Click Capabilities in the System section of the Administration main menu to open the Capabilities feature view.
– Click Create capability.
– Select Upgrade, then click Create capability to enable the upgrade capability.

Now perform the following operations in Nexus 3.x:

Step 1: Login as Admin in Nexus3.x

Step 2: Select as the following hierarchy

Nexus Repository Manager8

Nexus Repository Manager9

Nexus Repository Manager10

Nexus Repository Manager11

Nexus Repository Manager12

Step 3: Enter the copied URL and access token from Nexus 2.x and perform the further steps.

Nexus Repository Manager14

Nexus Repository Manager15

4) Running the Upgrade:
After the upgrade was started in the Preview screen, the repository manager starts with a short Preparing step. From this point on, no further configuration changes should be performed on version 2. They will not be moved to version 3. Any upgrade process invoked destroys any existing configuration in the target Nexus Repository Manager 3 server and replaces it with the upgraded configuration from version 2.

5) After the Upgrade:
With the upgrade completed and all components transferred, you can perform the next steps in your upgrade plan. These can include:
– Stopping Nexus Repository Manager 2.
– Archiving Nexus Repository Manager 2 and delete the install from the server.
– Reconfiguring Nexus Repository Manager 3 to use the HTTP port, context path and repository paths of version 2, if desired.

6) Configuring the legacy URL:
By default, Nexus Repository Manager 2 uses a different URL pattern to expose repositories and repository groups than Nexus Repository Manager 3. During upgrade from NXRM 2 to NXRM 3, a capability is added so that Nexus Repository Manager 3 automatically supports the old patterns and your automated tools and CI continue to work.
If you want the old URL format, you must make a configuration change. This can be done in $data-dir/nexus3/etc/ by adding:
The above URL needs to be added before the start of an upgrade so that the legacy URL will be matched.

Operations performed after upgrade:
Alter the Repository links associated with the project file and test whether the repositories in Nexus 3.x are being used/downloaded.