Nexus H2 repair steps for version 3.79

Hello Team,

I am performing the recovery of my h2 db in nexus3. Here are the steps and current setup.

Environment:

  • Nexus Version: 3.79.1
  • H2 Version: 2.2.224
  • Java Version: 11
  • Deployment: **OpenShift **

Steps i am performing for H2 DB Recovery

  1. Scaled down Nexus pod and opened a debug container.
  2. Ran H2 Recover tool:
    Shell

java -cp /sonatype/nexus/system/com/h2database/h2/2.2.224/h2-2.2.224.jar
org.h2.tools.Recover
-dir /nexus-data/db
-db nexus

But “/sonatype/nexus/system/com/h2database/h2/2.2.224/h2-2.2.224.jar”
is not present in nexus 3.79 , but it does in nexus 3.70

so is there any other ways to get the corrupted data back .

In newer versions of Nexus the jar is embedded in a single jar (we also use a newer version of H2). You can also download H2 the h2 jar yourself.

Reminder we don’t recommend using H2 in Kubernetes environments as it does not guarantee graceful shutdown which may lead to database corruption

@mpiggott Thanks for the reply . Do we have any other steps to access the H2 console in nexus 3.79
want to changes the password of admin user . want to replace it with the password created for H2 from terminal .

You might check to see if H2 has an OpenShift operator and mount the volume in that operator. Aside from that you may need to extract the database from the volume and use h2 outside of openshift.