Problem with nexus server migration to new hardware

Hope it’s ok to dig up and old issue, but I had the same problem and managed to get it working.
I am trying to copy our Nexus 3.34.1 from AIX 7.2 to RedHat 7.

I copied everything and when trying to start Nexus I got the same issues with the OrientDB.
The approach with backing up the OrientDB from the scheduled task and then restoring them from backup on RedHat didn’t work either. The same magic number errors, caused by the difference in hardware probably.

The solution that worked for me was to export the OrientDB databases with the orientdb console as JSON files. Or did you try that option as well?
Not sure if you need to do it for all databases or just component, config and security… I did it for 3 others as well.

Export the databases as JSON files via the orientdb console, replacing /app/nexus with your own path to the sonatype-work directory.
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/accesslog admin admin
EXPORT DATABASE accesslog-export
DISCONNECT
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/analytics admin admin
EXPORT DATABASE analytics-export
DISCONNECT
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/audit admin admin
EXPORT DATABASE audit-export
DISCONNECT
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/component admin admin
EXPORT DATABASE component-export
DISCONNECT
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/config admin admin
EXPORT DATABASE config-export
DISCONNECT
CONNECT PLOCAL:/app/nexus/sonatype-work/nexus3/db/security admin admin
EXPORT DATABASE security-export
DISCONNECT

Copy the entire installation to the new Linux platform.
Now on the new Linux platform.

Remove these directories from the copy:

  • sonatype-work/nexus3/db/accesslog
  • sonatype-work/nexus3/db/analytics
  • sonatype-work/nexus3/db/audit
  • sonatype-work/nexus3/db/component
  • sonatype-work/nexus3/db/config
  • sonatype-work/nexus3/db/security
    Import the gzipped JSON files via the orientdb console to create new databases.
    It needs the path to the json.gz file, I started my orientdb console session from the same path where I placed the backup files.

CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/accesslog
IMPORT DATABASE accesslog-export.json.gz
DISCONNECT
CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/analytics
IMPORT DATABASE analytics-export.json.gz
DISCONNECT
CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/audit
IMPORT DATABASE audit-export.json.gz
DISCONNECT
CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/component
IMPORT DATABASE component-export.json.gz
DISCONNECT
CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/config
IMPORT DATABASE config-export.json.gz
DISCONNECT
CREATE DATABASE PLOCAL:/app/nexus/sonatype-work/nexus3/db/security
IMPORT DATABASE security-export.json.gz
DISCONNECT

After that I was able to start the copied Nexus without any problems.