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:
Stop Nexus Repository.
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
.Unzip the zip file for the backup you wish to restore; this will reveal a backup file with a name like
nexus.mv.db
.Copy the backup file (e.g.,
nexus.mv.db
) from this location.Locate the
$data-dir/db
directory and the existing database file (typicallynexus.mv.db
) it contains.Replace the
nexus.mv.db
file that is currently in the$data-dir/db
directory with the one from your backup location.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.
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 System → Tasks in the Administration UI.
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:
Stop Nexus Repository.
Remove the following directories from
$data-dir/db
:component
config
security
Go to the backup location that you specified when creating the Admin - Export databasesfor backup task.
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).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.
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 System → Tasks in the Administration UI.
Restart Nexus Repository.
Verify Nexus Repository is running correctly.
Remove
.bak
files fromrestore-from-backup
directory.You can verify the restoration is complete by viewing the fully-restored databases previously removed from
$data-dir/nexus3/db
.