Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore a deleted component in Sonatype Nexus 3

In Nexus Repository Manager 2 you could move deleted assets/components on the server from the .trash-folder to repository to restore anything you might have deleted. This is because Nexus stored Components as individual files on disk.

Sonatype Nexus 3 stores Components as blobs. My guess would be that with Nexus 3 the deletion marks the component as deleted in some column in the database. Is the solution to connect to the database with Sonatype provided instructions and manipulate the database data?

Sonatype support in this case has this information: https://support.sonatype.com/hc/en-us/articles/115002930827-Accessing-the-OrientDB-Console

In short connect with:

Unix

java -jar ./lib/support/nexus-orient-console.jar

Windows

java -jar lib\support\nexus-orient-console.jar

Mac

.install4j/jre.bundle/Contents/Home/jre/bin/java -jar ./lib/support/nexus-orient-console.jar

Exit console:

exit

The Nexus Repository Manager I'm using is version 3.2.0-01 and the nexus-orient-console.jar is in that release too.

like image 877
krowl1000 Avatar asked Nov 18 '22 17:11

krowl1000


1 Answers

If you want to restore a soft deleted repository and blobs, the solution is to create the blob store with the original name and also create the same name of the repository. Then run the "repair - reconcile component database from blob store" task.

Note: you can change the blob store name and the repository as well. In the blob replace all properties files with new repo name.

This method is applicable for moving blob store and repo to other nexus server.

like image 163
naan Avatar answered Dec 31 '22 00:12

naan