How to recover from deleted Sonatype Nexus library

 From: https://my.oschina.net/u/178116/blog/519840

 Today, when sorting out the company's Maven private server, I accidentally deleted the Release library. Immediately broke out in a cold sweat! All the company's accumulation is gone. The first way that flashed in my mind was to see if there was a recycle bin. I happened to see a function called Trash... in the Nexus UI. But after I clicked it, I found that there was only the function of Empty Trash, which is worth pressing. Don't press it!

 

    Finally, an article was found in the official search of Sonatype Nexus. The original text is as follows:

When you delete a repository from the Nexus UI, nexus will remove the repository from any groups it belongs too and move the repository contents to it's trash folder. Sometimes you will want to restore this repository back into service.

To restore a deleted repository with id of 'releases':

1. mv sonatype-work/nexus/trash/releases sonatype-work/storage so that you end up with sonatype-work/storage/releases
2. Recreate the repository with the same repository id 'releases' using the repositories tab user interface.
3. Add the repository to any groups that it was in before.

The act of creating the repository in the UI will force a reindex of the previous repository storage contents.

    fortunately! Found a way to recover deleted files. Finally, according to the official method, all the data under the deleted Release library was successfully restored. The operation steps are as follows:

 

  1. First find the library you deleted under sonatype-work/nexus/tra sh and save it elsewhere;

  2. Then click Add through the nexus console, select Hosted Repository, and enter the deleted Repository information;


  3. Copy the library file you just saved to the specified sonatype-work/nexus/storage/[releases];

  4. Click on Public Repositories in the list, then add Releases to Ordered Group Repositories under the Configuration tab below;

  5. Finally, you can save it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326326455&siteId=291194637