## DB migrator failing

### post by mbender on Aug 14, 2024

Mateusz Bender

I’m trying to somehow upgrade the docker-based Orient DB installation to H2 so that the latest Nexus3 image can use it. Alas, so far, I’m not having any successes. At a glance it seems the migration jar is simply broken. However, this could also be a case of Java version (I’ve tested this both with 11 and 17).

Current logs:

```auto
/nexus-data/db_bak $ java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M -jar nexus-db-migrator-*.jar --migration_type=h2
15:25:26 [main] WARN  c.s.n.d.migrator.MigratorApplication - Please ensure any Nexus Repository instance has been gracefully shut down before proceeding.
15:25:26 [main] INFO  c.s.n.d.migrator.MigratorApplication - Do you want to continue [y/n]?
y
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - --content_migration parameter is absent. Setting it to true.
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - Force parameter wasn't found. Setting it to false by default.
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - Java version: Alpine 17.0.11
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - JVM arguments: -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - Migrator arguments: --migration_type=h2 --content_migration=true --export_json=false --force=false
15:25:28 [main] INFO  c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
15:25:29 [main] INFO  c.s.n.d.migrator.MigratorApplication - Starting MigratorApplication v3.70.1-03 using Java 17.0.11 on a5ba1a3aa1b9 with PID 27 (/nexus-data/db_bak/nexus-db-migrator-3.70.1-03.jar started by nexus in /nexus-data/db_bak)
15:25:29 [main] INFO  c.s.n.d.migrator.MigratorApplication - No active profile set, falling back to 1 default profile: "default"
15:25:34 [main] INFO  o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2
15:25:34 [main] INFO  c.s.n.d.migrator.MigratorApplication - Started MigratorApplication in 5.572 seconds (JVM running for 9.692)
15:25:34 [main] INFO  o.s.b.a.b.JobLauncherApplicationRunner - Running default command line with: [--migration_type=h2, --content_migration=true, --export_json=false, --force=false]
15:25:34 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory contains .bak files: /nexus-data/db_bak
15:25:34 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory does not contain database files: /nexus-data/db_bak
15:25:34 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory contains .bak files: /nexus-data/db_bak
15:25:34 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory does not contain database files: /nexus-data/db_bak
15:25:34 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Migration job started at Wed Aug 14 15:25:34 GMT 2024
15:25:34 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [startHealthCheckDeciderStep]
15:25:34 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [startHealthCheckDeciderStep] executed in 15ms
15:25:34 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [unzipArchivesStep]
15:25:34 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /nexus-data/db_bak/component-2024-08-14-15-24-01-3.70.1-02.bak to /nexus-data/db_bak/component
15:25:35 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /nexus-data/db_bak/component-2024-08-14-15-24-01-3.70.1-02.bak successfully
15:25:35 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /nexus-data/db_bak/config-2024-08-14-15-24-01-3.70.1-02.bak to /nexus-data/db_bak/config
15:25:35 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /nexus-data/db_bak/config-2024-08-14-15-24-01-3.70.1-02.bak successfully
15:25:35 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /nexus-data/db_bak/security-2024-08-14-15-24-01-3.70.1-02.bak to /nexus-data/db_bak/security
15:25:35 [main] INFO  c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /nexus-data/db_bak/security-2024-08-14-15-24-01-3.70.1-02.bak successfully
15:25:35 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [unzipArchivesStep] executed in 551ms
15:25:35 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [checkModelVersionsStep]
15:25:36 [main] ERROR o.s.batch.core.step.AbstractStep - Encountered an error executing step checkModelVersionsStep in job migrationFromOrientNoExportJSONJob
java.lang.ExceptionInInitializerError: null
        at com.orientechnologies.orient.core.engine.local.OEngineLocalPaginated.startup(OEngineLocalPaginated.java:64)
        at com.orientechnologies.orient.core.Orient.startEngine(Orient.java:930)
        at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:523)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:173)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:154)
        at com.sonatype.nexus.db.migrator.tasklet.ModelVersionsChecker.execute(ModelVersionsChecker.java:47)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:407)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:331)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.doInIteration.java:82)
        at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.getNextResult:375)
        at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.executeInternal);  // Truncated Log for brevity
```

Any idea what kind of procedure I need to follow to actually do the upgrade? The documentation is lax on the Java requirements or issues with the migration tool…

2.2k
views

### post by mbender on Aug 14, 2024

Mateusz Bender

I’ve managed to resolve this. See [this community answer](https://community.sonatype.com/t/migrating-to-3-71-on-a-docker-based-installation/13045/5).
