Migrating to 3.71 on a docker-based installation

OK, I’ve managed to resolve this.

Here are the steps I took:

  1. Create a database backup via Nexus tasks as normal; take the Nexus docker container offline
  2. 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)
  3. download the migrator utility from 3.70.x Downloads (for OrientDB)
  4. 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 the jar 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)
  1. the migrator will create a nexus.mv.db file in the backup directory; only this file is required!
  2. clear out the existing db folder on the docker-mapped Nexus drive, and place the new nexus.mv.db file there
  3. make sure to set the permissions for the nexus.mv.db file to match everything else! In my case I had to set chmod 200:200 nexus.mv.db, but this is dependant on how the docker Nexus drive is configured
  4. 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)
  5. 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”)
  6. 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.

3 Likes