OK, I’ve managed to resolve this.
Here are the steps I took:
- Create a database backup via Nexus tasks as normal; take the Nexus docker container offline
- copy the db backup to my local Windows machine (for me, personally, this was easier to work with than an endless string of console windows via docker and a Linux docker host)
The copy process is up to the reader to figure out - in my case my docker-based Nexus deployment was using a mounted drive, so it was easy (i.e. the backup was directly on my docker host drive and I could just copy it using WinSCP) - download the migrator utility from 3.70.x Downloads (for OrientDB)
- create another copy (just in case) of the database backup and run
java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M \ -jar nexus-db-migrator-*.jar \ --migration_type=h2
(modify as required for whichever shell is used; for Powershell I had to specify thejar
file using a./<filename>
format)
Note that I’ve got following regular Java installation from Oracle (for Windows):
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
- the migrator will create a
nexus.mv.db
file in the backup directory; only this file is required! - clear out the existing
db
folder on the docker-mapped Nexus drive, and place the newnexus.mv.db
file there - make sure to set the permissions for the
nexus.mv.db
file to match everything else! In my case I had to setchmod 200:200 nexus.mv.db
, but this is dependant on how the docker Nexus drive is configured - if no database changes were made to the docker-based
nexus.properties
file, then do NOT make any modifications to this file (contrary to the instruction set from Migrating to a New Database) - update the Nexus docker container definition to use the new
sonatype/nexus3:3.71.0-ubi
image (latest
would probably work as well, but I’d rather keep this guide relevant “here and now”) - Start your docker-based Nexus instance
The instance should recognize the new database file and update it accordingly to 3.71.*
.
EDIT: A DB migrated this way has some issues; see resolution in the following response.