Chapter 26Lesson 03200–280 min

Database and Instance Migration: OrientDB Sunset, H2/PostgreSQL Paths, and Migrator Workflows: Configuration, Design Choices, and Tradeoffs

A correct migration path can still be a poor production design. This lesson compares side-by-side and in-place changes, offline database transformation and live instance transfer, H2 and PostgreSQL operating models, stable and changing blob locations, secret migration, maintenance windows, and rollback economics.

Architecture choicesDowntimeSide-by-sideSecretsRollback economics

Learning objectives

  • Choose in-place or side-by-side migration from failure domains, rollback needs, capacity, and permitted downtime.
  • Compare Database Migrator and Instance Migrator as operational patterns rather than interchangeable utilities.
  • Explain when H2 remains acceptable and why PostgreSQL is the production recommendation for larger/mission-critical deployments.
  • Design blob-store and secret migration without losing integrity or exposing credentials.
  • Build a migration decision record that makes cutover, validation, rollback, and post-migration ownership explicit.
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. Five decisions control most migration risk

Before writing commands, decide: (1) same deployment or separate target, (2) downtime budget, (3) target database, (4) whether blob location/type changes, and (5) how long the old source remains a tested rollback option. Tool choice follows those decisions.

2. Decision matrix

Scenario Likely pattern Main advantage Main risk/cost
H2→PostgreSQL, same instance, same blob stores Offline Database Migrator Direct database-platform change Downtime and temporary resource requirement
OrientDB 3.70.5→new modern target with different storage Instance Migrator candidate Configuration + hosted content movement, resumable Target prep, exclusions/manual configuration, dual-instance operation
OrientDB→H2/PostgreSQL in-place legacy path Version-specific Database Migrator path Keeps existing deployment/storage topology Offline window and strict legacy version gate
Small non-mission-critical lab H2 stays H2 No migration Operational simplicity H2 concurrency/HA/scale limits remain
Production H2 under growth pressure H2→PostgreSQL External DB operational model recommended for production DBA ownership, migration window, new failure domain

3. In-place minimizes topology change but couples rollback to the same environment

With an in-place database migration, repository URLs, blob locations, process identity, and surrounding network may remain stable. That reduces client cutover work. The tradeoff is that the maintenance window operates on the same platform and rollback must be especially disciplined. Preserve the source database plus matching blobs before the transformation, and do not let “same host” become permission to overwrite the only checkpoint.

4. Side-by-side buys validation and rollback isolation

A separate target can be built, patched, configured, and tested before traffic moves. This is attractive for legacy OrientDB modernization because the target can use a modern Nexus/Java/PostgreSQL stack while the source remains on the legacy compatibility line. It also enables canary client tests and keeps the old endpoint available during acceptance.

The cost is double capacity for a period, explicit DNS/repository URL cutover, secret/external identity setup, and a policy for writes that occur while both systems coexist.

5. “No downtime” does not mean “no cutover discipline”

Instance Migrator can move data while source and target are running and continue polling for new assets. You still need a final consistency/cutover phase: define when publication stops or is redirected, wait for the final transfer state, verify failures/retries, test consumers, and then move traffic. Otherwise two writable repositories can diverge and make rollback ambiguous.

6. H2 versus PostgreSQL is an operating-model choice

H2 remains useful for small, non-mission-critical deployments and learning, but current Sonatype guidance highlights concurrency, corruption, and high-availability limitations. PostgreSQL adds a separate database service, connection pool, network path, monitoring, backup/PITR, ownership, extension, and performance responsibilities—but is the recommended production database.

Dimension H2 PostgreSQL
Administration Embedded/simple Separate DBA/platform lifecycle
Concurrency/scale More constrained Better production scaling model
HA Not supported as HA DB Can use supported external DB resiliency architecture
Backup Nexus H2 task + periodic offline recommendation PostgreSQL-native backup/PITR strategy
Failure domains Coupled to Nexus host/storage Additional network/DB service dependencies

7. Database migration and blob migration are independent axes

Changing H2→PostgreSQL does not inherently require changing blob storage. Changing a file blob store to object storage does. Make this explicit in the plan:

migration:
  database:
    from: H2
    to: PostgreSQL
    tool: Database Migrator
  blobs:
    from: /srv/nexus/blobs
    to: /srv/nexus/blobs
    movementRequired: false
  endpoint:
    changes: false

If movementRequired becomes true, do not silently bolt a generic recursive copy onto the plan. Re-evaluate whether Instance Migrator or a Sonatype-supported blob/storage migration procedure is the correct method.

8. Secrets are migration state, not just configuration text

Repository upstream credentials, S3/object-store keys, LDAP bind passwords, SAML keys, user tokens/API keys, email credentials, and signing material may need special handling. Current Instance Migrator uses a migrator cipher for supported encrypted secrets; without the required cipher configuration, sensitive values may not migrate and must be reconfigured manually. That is preferable to silently leaking them into logs or export files.

Never create an evidence bundle containing live passwords, tokens, private keys, or cloud credentials. Record only whether a secret category was migrated/reconfigured and whether the target integration passed a controlled test.

9. Hosted content and proxy caches have different migration value

Current Instance Migrator guidance states that hosted repository content is migrated; proxy repository cached content is not the primary content-transfer target. That is sensible: a proxy cache can often be repopulated from the upstream, while hosted artifacts may be authoritative internal releases. But proxy repository configuration, routing, remote credentials, negative cache behavior, and network reachability still need validation.

10. Regenerated metadata is not evidence of artifact mutation

Format-specific index metadata may be regenerated on the target. Compare immutable artifact bytes/digests separately from generated Maven/APT/Yum/Helm/RubyGems metadata. A changed generated index can be expected while the underlying hosted artifact SHA-256 remains identical. Conversely, matching generated metadata cannot excuse a changed artifact checksum.

11. Rollback cost rises after every accepted write

Before cutover, rollback can be as simple as abandoning the target and keeping the source. After cutover, every target-only publication creates a reconciliation decision. Define a rollback window, a publication freeze or dual-write prohibition, and a source-of-truth rule. If rollback occurs, replay target-only legitimate artifacts from trusted CI/build evidence rather than inventing ad hoc database merges.

12. Separate migration from upgrade when the path requires it

Legacy OrientDB modernization often has two coupled changes: database migration and then Nexus/Java upgrade. Keep them as explicit phases with a validation checkpoint between them. If the migration is not validated, adding a major Nexus/Java upgrade makes diagnosis harder and can consume the rollback window.

13. Worked decision record

decision: "migrate production H2 to PostgreSQL"
source:
  nexus: "3.95.2-01"
  db: H2
  blob: file
constraints:
  maintenanceWindowMinutes: 180
  endpointMustStaySame: true
choice:
  pattern: "in-place database migration"
  tool: "Database Migrator"
  blobMovement: false
rollback:
  checkpoint: "verified pre-migration DB + corresponding blobs"
  targetWritesBeforeAcceptance: false
acceptance:
  - postMigrationTasksComplete
  - repositoryCountsExplained
  - criticalAssetSha256Matches
  - leastPrivilegeAuthPasses
  - controlledClientDownloadPasses

14. Knowledge check

What is the strongest reason to choose side-by-side migration?

Does live Instance Migrator eliminate the need for a final publication/cutover window?

Why is changing database and blob storage at the same time riskier?

Why can format metadata differ after migration without proving artifact corruption?

What should happen to target-only writes if rollback is required?

15. Summary and bridge

You can now select a migration architecture, not merely a migrator binary. Lesson 4 applies this model to failures: wrong versions, wrong PostgreSQL ownership, missing extensions, blob mapping errors, incomplete post-migration tasks, and deceptively matching counts.

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.