Chapter 26Lesson 01220–300 min

Database and Instance Migration: OrientDB Sunset, H2/PostgreSQL Paths, and Migrator Workflows: Concepts, Architecture, and Mental Model

Migration is not “copy the database and hope.” Nexus migration is a controlled transition from a precisely identified source state to a supported target state. The source Nexus version, database engine, Java runtime, blob location, edition, repository formats, secrets, and target topology determine which Sonatype tool is valid and what must be validated before cutover.

OrientDB sunsetH2 / PostgreSQLDatabase MigratorInstance MigratorCompatibility gates

Learning objectives

  • Explain why OrientDB, H2, PostgreSQL, Nexus version, Java runtime, and blob stores are separate compatibility dimensions.
  • Distinguish Database Migrator from Instance Migrator by topology, downtime model, state moved, and rollback implications.
  • Describe the final OrientDB migration gate and why legacy sources must remain on the 3.70.5 line until migration.
  • Identify PostgreSQL ownership, schema, extension, capacity, and credential prerequisites before attempting migration.
  • Define a migration acceptance model based on configuration, repository/component counts, checksums, security, clients, logs, and post-migration rebuild completion.
Dated baseline (27 August 2026). Modern examples use Nexus Repository 3.95.2-01 with Java 21 as the target/reference line. Legacy OrientDB migration examples intentionally pin the source to the final supported OrientDB line, 3.70.5, and do not pretend that 3.95.x can open an OrientDB data directory.
Tool boundary. Database Migrator changes the database backing a self-hosted deployment and requires Nexus to be shut down; it does not move repository blob content. Instance Migrator is a separate live source→target tool that migrates configuration plus hosted assets and tracks migration state. Choose the tool from the migration topology, not from familiarity with a command.
Recovery checkpoint first. Before any migration, take and verify a supported backup/recovery set for the source database/configuration and blob stores. Keep the source untouched until the target passes validation. Do not copy database files across incompatible Nexus versions, rewrite rows, edit blob metadata, or downgrade an already-upgraded data directory as a rollback shortcut.

1. The practical problem: the database is part of the product state

Chapter 25 established that Nexus recovery depends on a coherent database/configuration and blob-store recovery set. Migration adds a second constraint: the source and target must be connected by a supported migration path. A database that is healthy on one Nexus release is not a portable file format that can be dropped under any later release. Schema evolution, Java requirements, storage metadata, security secrets, and format-specific generated metadata all participate in the transition.

The safe question is therefore not “How do I move $data-dir/db?” It is: “What exact source state do I have, what exact target state do I need, which current Sonatype migration workflow connects them, and how will I prove the result?”

2. Migration mental model

Source evidence → compatibility gate → supported migrator → target validation → cutover
flowchart TD
  S[Source instance
version + edition + Java]
  D[(Source DB
OrientDB / H2 / PostgreSQL)]
  B[(Blob stores
file / object)]
  G{Compatibility gate
source + target + tool}
  DM[Database Migrator
offline DB transformation]
  IM[Instance Migrator
live config + hosted assets]
  T[Target instance
H2 / PostgreSQL]
  V[Validation
config + counts + hashes + auth + clients]
  C[Controlled cutover]
  R[Rollback checkpoint
untouched source + matching blobs]
  S --> G
  D --> G
  B --> G
  G -->|same deployment / DB platform change| DM
  G -->|source → new target / content movement| IM
  DM --> T
  IM --> T
  T --> V --> C
  G --> R

The diagram has two different migration engines because they solve different problems. Database Migrator transforms database state for a self-hosted deployment. Instance Migrator treats the source and target as separate running Nexus instances and moves supported configuration and hosted repository assets through the product interfaces while tracking transfer state.

3. Inventory the source before choosing a tool

Capture a source manifest before any migration action:

source:
  nexusVersion: "3.70.5"        # example legacy source
  edition: "Community"
  java: "11"                    # legacy OrientDB source only
  database: "OrientDB"
  blobStores:
    - name: "default"
      type: "file"
      location: "<documented-source-path>"
  repositories:
    hosted: 4
    proxy: 3
    group: 2
  security:
    localUsers: 7
    roles: 11
    externalIdentity: "LDAP"
  evidence:
    componentCount: 12543
    sampleSha256: "SYNTHETIC-EXPECTED-HASH"

The values are evidence, not decoration. They drive tool selection, target preparation, maintenance windows, secret handling, and acceptance criteria.

4. OrientDB is a legacy source state, not a modern target

OrientDB entered extended maintenance in 2024 and is officially sunset. Nexus Repository 3.70.x is the last line that supports OrientDB; 3.71.0 and later do not. A legacy OrientDB deployment that needs to move forward must first reach the supported migration source state—currently 3.70.5—while staying on the Java level that OrientDB supports. Only after the database transition does the instance move to newer Nexus/Java requirements.

This sequencing matters. Starting a 3.95.x binary against an OrientDB data directory is not an upgrade strategy. Neither is upgrading the legacy source to a Java release its database cannot use.

5. Database Migrator versus Instance Migrator

Dimension Database Migrator Instance Migrator
Primary purpose Change database platform for self-hosted Nexus Move configuration/content from one Nexus instance to another
Execution model Offline; Nexus shut down Live; source and target running
State moved Database schema/metadata; blob content is not migrated Supported configuration plus hosted repository assets
Resume/retry Single migration execution Persistent state, polling, transfer retry/logs
Useful for blob-location change Only if target can still use/copy the correct blob content through a separate supported storage plan Yes, when content must move between source/target blob locations
Legacy OrientDB Supported documented OrientDB→H2/PostgreSQL database migrations, version-gated Current source gate 3.70.5; target 3.90.2+ per current Instance Migrator docs

6. Database Migrator: metadata transformation, not blob transfer

For a current H2→PostgreSQL migration, Sonatype’s documented path is: back up H2, prepare PostgreSQL, shut down Nexus, run the current Database Migrator from the data database directory with the target JDBC connection, run the documented PostgreSQL maintenance step, then start Nexus and allow required post-migration rebuild tasks to complete.

Critical: the Database Migrator documentation explicitly states that repository content is not migrated. If the blob store location changes, plan that content movement separately or choose a topology/tool that migrates assets. Never assume matching component counts mean the target has the bytes.

7. Instance Migrator: a source→target migration

Current Instance Migrator documentation lists self-hosted OrientDB 3.70.5 as the source and a self-hosted 3.90.2+ target using H2 or PostgreSQL as supported scenarios, with Java 25 required for the migrator tool itself. Both instances are running. The utility exports configuration-as-code, queues hosted assets, maintains per-repository migration state, and can continue polling for new assets while the migration is in progress.

That does not mean every Nexus state object is identical after migration. Current target-specific documentation lists exclusions and manual follow-up such as LDAP connection configuration, realms, audit logs, some format-specific metadata, and other target constraints. Read the target-specific workflow instead of relying only on a high-level feature list.

8. PostgreSQL is not “a host and password”

Current Sonatype requirements expect the Nexus database user to own the database. Upgrades/schema changes require ownership, and a non-owner user is not a supported configuration. PostgreSQL also requires the pg_trgm extension. If a separate schema is used, the Nexus user needs appropriate USAGE/CREATE permissions and the schema must be on the user’s search path.

-- Disposable example only; choose locale/settings for your platform.
CREATE USER nexus_lab WITH PASSWORD 'password-FAKE_DO_NOT_USE';
CREATE DATABASE nexus_lab OWNER nexus_lab ENCODING 'UTF8';
\c nexus_lab
CREATE SCHEMA nexus AUTHORIZATION nexus_lab;
CREATE EXTENSION pg_trgm SCHEMA nexus;

In a real environment, database creation belongs to the DBA/platform control plane and credentials belong in a secret store—not in lesson files or shell history.

9. Migration needs temporary capacity

Current Database Migrator guidance calls for substantial temporary resources: at least 16 GB available RAM and roughly three times the database-directory size in disk headroom, with a minimum temporary-space expectation. Treat those as preflight gates, not after-the-fact tuning tips. A migration that fills the source filesystem can turn a controlled change into a recovery incident.

10. “Migrator exited successfully” is not the finish line

After database migration, Nexus runs rebuild/normalization work for browse/search and other internal derived state. Some formats require additional metadata rebuild operations. Do not restart repeatedly or open production traffic while those required post-migration tasks are incomplete. Record task history/logs and wait for a stable target before acceptance testing.

11. Rollback is a state-consistency problem

Database Migrator is designed to leave the original source database unchanged, which is useful as a checkpoint. But once the migrated target starts accepting writes, database and blob content diverge from the source checkpoint. Reverting to an earlier database therefore requires the matching pre-migration blob state as well. The same principle applies to side-by-side cutover: preserve the source, freeze/route writes deliberately, and know exactly which post-cutover writes would be lost on rollback.

12. Acceptance ladder

  1. Target starts on the intended Nexus/Java/database combination.
  2. Repository definitions, blob-store mappings, cleanup/routing policies, users/roles/privileges, and external-identity configuration are accounted for.
  3. Hosted component/asset counts are within explained expectations.
  4. Sample/critical assets resolve and SHA-256 values match the source evidence.
  5. Proxy/group behavior is tested as behavior, not inferred from hosted counts.
  6. Least-privilege users can read/write only what the design permits.
  7. Browse/search/format metadata rebuilds complete.
  8. Logs/tasks show no unresolved migration failures.
  9. A controlled client request succeeds against the target endpoint.
  10. Rollback remains possible until the acceptance decision is signed off.

13. Why this matters in DevOps

A repository migration sits in the release path for every consumer that resolves dependencies or images. Treating migration as an audited change—with source evidence, compatibility gates, rehearsed rollback, deterministic validation, and explicit cutover—turns it from a risky “storage maintenance” event into normal platform engineering.

14. Knowledge check

Why can’t you simply copy an OrientDB directory into Nexus 3.95.x?

Which tool is the better fit for H2→PostgreSQL in the same self-hosted deployment?

When is Instance Migrator more appropriate?

Why is PostgreSQL database ownership a gate?

Why is the original database alone not a complete rollback point after target writes begin?

15. Summary and bridge

You now have the migration mental model: inventory first, choose the tool from topology, respect legacy and target version gates, prepare PostgreSQL correctly, preserve coherent rollback state, and validate beyond a successful process exit. Lesson 2 turns that model into a disposable workflow with executable fixtures and current command shapes.

Official references and version notes

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.