Skip to main content

Restore Exported Databases

This topic covers steps for restoring an OrientDB or H2 database that you previously exported using a Sonatype Nexus Repository task. Note that you will also need to restore your blob stores containing components as part of this process. For details on how to back up a blob store, see Blob Store Backup.

Restoring an Exported H2 Database

The steps below cover restoring your H2 component database after running the Admin - Backup H2 Database task. You will need to restore your blob stores containing components separately. Not doing so will cause synchronization issues between the blob store and database.

The restoration should include all of the databases exported during the backup process. Do not restore the databases individually, and only use files from a single backup (i.e., those with the same timestamp).

To restore an exported H2 database, take the following steps:

  1. Stop Nexus Repository.

  2. Locate the backup location directory that you specified when creating the Admin - Backup H2 Database task. This directory will contain a packaged zip with a timestamped name like nexus-2024-09-05-10-02-29.zip.

  3. Unzip the zip file for the backup you wish to restore; this will reveal a backup file with a name like nexus.mv.db.

  4. Copy the backup file (e.g., nexus.mv.db) from this location.

  5. Locate the $data-dir/db directory and the existing database file (typically nexus.mv.db) it contains.

  6. Replace the nexus.mv.db file that is currently in the $data-dir/db directory with the one from your backup location.

  7. Restore your blob store backup corresponding with your database backup. Not doing this will cause synchronization issues between the blob store and the database. For details on how to back up a blob store, see Blob Store Backup.

    1. If the blob store and database backups were not taken at exactly the same moment they may be out of sync following a restore. To fix this, schedule and run a Repair - Reconcile component database from blob store task under SystemTasks in the Administration UI.

  8. Restart Nexus Repository and verify that everything is running correctly.

Restoring an Exported Legacy OrientDB Database

The steps below cover restoring your OrientDB component database after running the Admin - Export databases for backup task. You will also need to restore the corresponding blob stores containing components. Not doing so will cause synchronization issues between the blob store and the database.

The restoration should include all of the databases exported during the backup process. Do not restore the databases individually, and only use files from a single backup (i.e., those with the same timestamp).

To restore your exported OrientDB database, take the following steps:

  1. Stop Nexus Repository.

  2. Remove the following directories from $data-dir/db:

    • component

    • config

    • security

  3. Go to the backup location that you specified when creating the Admin - Export databasesfor backup task.

  4. Copy the corresponding .bak files to $data-dir/restore-from-backup for restoration (Note: For version 3.10.0 or earlier use $data-dir/backup as the restore location).

  5. Restore blob store backup corresponding to the DB backup. Note that not doing this will cause synchronization issues between the blob store and the database.

    1. If the blob store and database backups were not taken at exactly the same moment they may be out of sync following a restore. To fix this, schedule and run a Repair - Reconcile component database from blob store task under SystemTasks in the Administration UI.

  6. Restart Nexus Repository.

  7. Verify Nexus Repository is running correctly.

  8. Remove .bak files from restore-from-backup directory.

  9. You can verify the restoration is complete by viewing the fully-restored databases previously removed from $data-dir/nexus3/db.