Nexus 3.71 Only supports H2 Databases, while older versions used OrientDB, Nexus 3.70 supports both H2, and Oriendb so you need to first upgrade to 3.70, because of schema problems, if you are versions older than 3.69, you need to first upgrade into 3.69.
---
Title: Nexus upgrade process
---
flowchart TD
A[Nexus upgrade start] --> B{Current version}
B -->|3.68 or older| C[Upgrade to 3.69]
B -->|3.69| D[Upgrade to 3.70]
C --> D
D --> E{Database}
E -->|Orient DB| F[Migrate Databse to H2]
E -->|H2| G[Upgrade to > 3.71]
F --> G
To migrate database from OrientDB to H2, you need to first upgrade into version 3.70 then, you can follow official docs to migrate your database: docs
-
Download migrator tool: https://help.sonatype.com/en/orientdb-downloads.html
or
wget https://download.sonatype.com/nexus/nxrm3-migrator/nexus-db-migrator-3.70.2-01.jar
-
Export a backup from Nexus UI -> tasks
-
stop nexus
-
place migrator tool in backp path
-
run Migration tool:
java -Xmx6G -Xms6G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M -jar nexus-db-migrator-3.70.2-01.jar --migration_type=h2
-
move
nexus.mv.db
file to your$data-dir/db
directory -
Edit the $data-dir/etc/nexus.properties file and add the following line:
nexus.datastore.enabled=true
- start nexus
You dont really need to set Xmx to 16G, for a normal database, 4G is also enough.
to upgrade a nexus instance, after downloading and extracting latest version of nexus from: https://help.sonatype.com/en/download.html
first you need to compare important
config files and apply needed changes. also you need t copy your keystore:
vimdiff nexus-3.70.2-01/bin/nexus.vmoptions nexus-3.72.0-04/bin/nexus.vmoptions
vimdiff nexus-3.70.2-01/etc/jetty/jetty-https.xml nexus-3.72.0-04/etc/jetty/jetty-https.xml
vimdiff nexus-3.70.2-01/etc/jetty/jetty.xml nexus-3.72.0-04/etc/jetty/jetty.xml
vimdiff nexus-3.70.2-01/etc/jetty/nexus-web.xml nexus-3.72.0-04/etc/jetty/nexus-web.xml
vimdiff nexus-3.70.2-01/etc/karaf/config.properties nexus-3.72.0-04/etc/karaf/config.properties
vimdiff nexus-3.70.2-01/etc/nexus-default.properties nexus-3.72.0-04/etc/nexus-default.properties
cp nexus-3.70.2-01/etc/ssl/keystore.jks nexus-3.72.0-04/etc/ssl/keystore.jks
Versions after 3.70
need java 17, install java 17 on ubuntu:
sudo apt install openjdk-17-jdk
and you can change active java version by:
sudo update-alternatives --config java
sudo update-alternatives --config javac
Also if you have set java home in your systemd unit file:
vim /etc/systemd/system/nexus.service
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/"