# Problem with nexus server migration to new hardware

**URL:** <https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572>\
**Category:** Sonatype Nexus Repository\
**Created:** [April 10, 2019, 7:16am UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572 "2019-04-10T07:16:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dch](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@dch](https://community.sonatype.com/u/dch)\
**Post date:** [April 10, 2019, 7:16am UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572/1 "2019-04-10T07:16:21Z")

</div>

Hello  
I’m using OSS 3.12.0-01 and trying to migrate from old server (aix 6.1) to new server (CentOS Linux).

I’ve copied all my data folders (whole sonatype-work) on new hardware while old server was stopped, but  
every time I’m trying to start new server there are problems with orientdb:

\*2019-04-10 08:20:49,907+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘internal.pcl’._

I’ve tried remove all old orientdb and restore them from backup as written in documentation but errors with magic number still exists:

\*2019-04-10 08:20:46,125+0200 INFO [FelixStartLevel] _SYSTEM ROOT - Storage ‘plocal:/nexus/sonatype-work/nexus3/db/config’ is created under OrientDB distribution : 2.2.34 (build f340442755a31eabc91b87cb3ef99eda5cee6ebd, branch 2.2.x)_  
\*2019-04-10 08:20:46,134+0200 INFO [ForkJoinPool.commonPool-worker-2] _SYSTEM ROOT - Storage ‘plocal:/nexus/sonatype-work/nexus3/db/security’ is created under OrientDB distribution : 2.2.34 (build f340442755a31eabc91b87cb3ef99eda5cee6ebd, branch 2.2.x)_  
\*2019-04-10 08:20:49,606+0200 INFO [FelixStartLevel] _SYSTEM org.sonatype.nexus.orient.internal.DatabaseRestorerImpl - restoration of database config from file /nexus/sonatype-work/nexus3/restore-from-backup/config-2019-04-07-10-31-52-3.12.0-01.bak starting_  
\*2019-04-10 08:20:49,606+0200 INFO [ForkJoinPool.commonPool-worker-1] _SYSTEM org.sonatype.nexus.orient.internal.DatabaseRestorerImpl - restoration of database analytics from file /nexus/sonatype-work/nexus3/restore-from-backup/analytics-2019-04-07-10-31-52-3.12.0-01.bak starting_  
\*2019-04-10 08:20:49,606+0200 INFO [ForkJoinPool.commonPool-worker-3] _SYSTEM org.sonatype.nexus.orient.internal.DatabaseRestorerImpl - restoration of database accesslog from file /nexus/sonatype-work/nexus3/restore-from-backup/accesslog-2019-04-07-10-31-52-3.12.0-01.bak starting_  
\*2019-04-10 08:20:49,854+0200 WARN [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Page 0 is broken in WAL segment 0 and will be truncated_  
\*2019-04-10 08:20:49,855+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} 1 pages in WAL segment analytics.31.wal are broken and will be truncated, some data will be lost after restore._  
\*2019-04-10 08:20:49,875+0200 WARN [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Storage ‘analytics’ was not closed properly. Will try to recover from write ahead log…_  
\*2019-04-10 08:20:49,876+0200 WARN [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Restore is not possible because write ahead log is empty._  
\*2019-04-10 08:20:49,901+0200 INFO [ForkJoinPool.commonPool-worker-2] _SYSTEM org.sonatype.nexus.orient.internal.DatabaseRestorerImpl - restoration of database security from file /nexus/sonatype-work/nexus3/restore-from-backup/security-2019-04-07-10-31-52-3.12.0-01.bak starting_  
\*2019-04-10 08:20:49,906+0200 INFO [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Storage data recover was completed_  
\*2019-04-10 08:20:49,907+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘internal.pcl’._  
\*2019-04-10 08:20:49,908+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘index.pcl’._  
\*2019-04-10 08:20:49,909+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘manindex.pcl’._  
\*2019-04-10 08:20:49,909+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘default.pcl’._  
\*2019-04-10 08:20:49,909+0200 ERROR [ForkJoinPool.commonPool-worker-1] _SYSTEM ROOT - $ANSI{green {db=analytics}} Magic number verification failed for page ‘0’ of ‘orole.pcl’._

I though that something is wrong with my Linux machine, so I’ve tried set up nexus server on windows pc. Unfortunately the same error with magic number as soon as restore complete.

Any advices ?

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [April 10, 2019, 2:00pm UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572/2 "2019-04-10T14:00:13Z")

</div>

The database looks to be corrupt. Does it boot on the original system? If so, I suggest trying the copy again, something went wrong during this attempt.

Rich

---

<div class="post-metadata">

**Author:** ![dch](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@dch](https://community.sonatype.com/u/dch)\
**Post date:** [April 10, 2019, 7:03pm UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572/3 "2019-04-10T19:03:56Z")

</div>

It is boot on original system. There were some problems on the original system (unexpected shutdown, database in ready only mode, but I’ve fixed this with rebuilding indexes), but right now original system works, but there are some errors from time to time about rolling back transactions.

I’ve tried copy this several times, using different tools (rsync, scp), the same result. Moreover the same magic number error appears from copying all nexus directories, or restoring database from backup (original system complete backup with success). I’ve even tried to export/import database using orientdb console. The same.

Am I missing something obvious here ? I’s moving nexus between different systems (unix, linux) allowed ?

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [April 10, 2019, 8:25pm UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572/4 "2019-04-10T20:25:12Z")

</div>

> I’ve tried remove all old orientdb and restore them from backup as written in documentation but errors with magic number still exists:

There is no need to do that. Just copy the work directory while Nexus is not running. See here for more information:

> **[Moving a Nexus Repository 3 Instance to a New Location](https://support.sonatype.com/hc/en-us/articles/360010352014-Moving-a-Nexus-Repository-3-Instance-to-a-New-Location)**
>
> .This article provides best practice and considerations for moving an existing Nexus Repository 3 self-hosted standalone server to a new server location under these conditions:
> Standalone Repositor...

---

<div class="post-metadata">

**Author:** ![pba](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pba](https://community.sonatype.com/u/pba)\
**Post date:** [October 5, 2021, 8:12am UTC](https://community.sonatype.com/t/problem-with-nexus-server-migration-to-new-hardware/1572/5 "2021-10-05T08:12:37Z")

</div>

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.
