# Wrong migration type 'h2' error on db migration from orientdb --\> H2

**URL:** https://community.sonatype.com/t/wrong-migration-type-h2-error-on-db-migration-from-orientdb-h2/13125
**Category:** Sonatype Nexus Repository
**Tags:** upgrade
**Created:** [August 27, 2024, 1:38am UTC](https://community.sonatype.com/t/wrong-migration-type-h2-error-on-db-migration-from-orientdb-h2/13125 "2024-08-27T01:38:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lesmccoolcb](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@lesmccoolcb](https://community.sonatype.com/u/lesmccoolcb)
#### Post date: [August 27, 2024, 1:38am UTC](https://community.sonatype.com/t/wrong-migration-type-h2-error-on-db-migration-from-orientdb-h2/13125/1 "2024-08-27T01:38:16Z")

</div>

I’m running into the following errors while attempting to upgrade Sonatype Nexus 3.70.1-02 to 3.71.0, orientdb → H2.

I’m following [these instructions](https://help.sonatype.com/en/migrating-to-a-new-database.html) on a Centos6 machine.

When invoking the migrator jar with the --migration\_type=h2 command, I get the following error in the output:

```auto
-sh-4.1$ /opt/jdk/bin/java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M -jar nexus-db-migrator-3.71.0-01.jar --migration_type=h2
19:14:45 [main] WARN c.s.n.d.migrator.MigratorApplication - Please ensure any Nexus Repository instance has been gracefully shut down before proceeding.
19:14:45 [main] INFO c.s.n.d.migrator.MigratorApplication - Do you want to continue [y/n]?
y
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - --content_migration parameter is absent. Setting it to true.
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - Force parameter wasn't found. Setting it to false by default.
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - Java version: Eclipse Adoptium 11.0.23
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - JVM arguments: -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - Migrator arguments: --migration_type=h2 --content_migration=true --export_json=false --force=false
19:14:49 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
19:14:50 [main] INFO c.s.n.d.migrator.MigratorApplication - Starting MigratorApplication v3.71.0-01 using Java 11.0.23 on jenkins.unidata.ucar.edu with PID 3808 (/mnt/nexus/backup/nexus-db-migrator-3.71.0-01.jar started by nexus in /mnt/nexus/backup)
19:14:50 [main] INFO c.s.n.d.migrator.MigratorApplication - No active profile set, falling back to 1 default profile: "default"
Warning: Nashorn engine is planned to be removed from a future JDK release
19:14:52 [main] INFO o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2
19:14:52 [main] INFO c.s.n.d.migrator.MigratorApplication - Started MigratorApplication in 3.279 seconds (JVM running for 7.538)
19:14:52 [main] INFO o.s.b.a.b.JobLauncherApplicationRunner - Running default command line with: [--migration_type=h2, --content_migration=true, --export_json=false, --force=false]
19:14:53 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
19:14:53 [main] ERROR o.s.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to execute ApplicationRunner
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776)
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
        at com.sonatype.nexus.db.migrator.MigratorApplication.main(MigratorApplication.java:117)
Caused by: com.sonatype.nexus.db.migrator.exception.MigratorJobParametersInvalidException: Wrong migration type 'h2'. List of available migration types: [h2_to_postgres, postgres_to_h2]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.orientechnologies.common.directmemory.OByteBufferPool (file:/mnt/nexus/backup/nexus-db-migrator-3.71.0-01.jar) to method sun.nio.ch.DirectBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of com.orientechnologies.common.directmemory.OByteBufferPool
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

```

I ran the above again with the --debug option. I’m unable to attach it, but it contains a lot of positive and negative matches, but the end of the log file look similar to what is listed above:

```auto
19:18:12 [main] ERROR o.s.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to execute ApplicationRunner
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776)
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
        at com.sonatype.nexus.db.migrator.MigratorApplication.main(MigratorApplication.java:117)
Caused by: com.sonatype.nexus.db.migrator.exception.MigratorJobParametersInvalidException: Wrong migration type 'h2'. List of available migration types: [h2_to_postgres, postgres_to_h2]

```

Thoughts on what might be the cause?

---

<div class="post-metadata">

### Author: ![michael.singer](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@michael.singer](https://community.sonatype.com/u/michael.singer)
#### Post date: [August 27, 2024, 2:57pm UTC](https://community.sonatype.com/t/wrong-migration-type-h2-error-on-db-migration-from-orientdb-h2/13125/2 "2024-08-27T14:57:15Z")

</div>

You need to use the OrientDB specific migrator JAR which can be downloaded at [3.70.x Downloads (for OrientDB) (sonatype.com)](https://help.sonatype.com/en/orientdb-downloads.html)

---

<div class="post-metadata">

### Author: ![lesmccoolcb](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@lesmccoolcb](https://community.sonatype.com/u/lesmccoolcb)
#### Post date: [August 28, 2024, 9:15pm UTC](https://community.sonatype.com/t/wrong-migration-type-h2-error-on-db-migration-from-orientdb-h2/13125/3 "2024-08-28T21:15:03Z")

</div>

Thanks Michael. Looks like I had an older version of the migrator jar. I’ll try the one you link to.
