To copy single repository from old instance to new

Hi,

We were using nexus on one server with lot of repositories within single blob, now we decided to have latest version of nexus on new server with same repos but with multiple bolbs (like 7-8 depending on artifact type).
We have installed new Nexus instance on new server. Now we want to migrate specific (single) repository to new server.

Let’s say one repository name is stratone (Source URL - http://nexusdev:8081/repository/straone/) which has releases and which we want to migrate as is on new instnace with same name stratone (Destination URL - http://nexusprod:8081/repository/straone)

How can we achieve this.

Thank you for your help.

I believe you want https://issues.sonatype.org/browse/NEXUS-11468 which is not yet completed.

In your case, it is worth noting the entire data directory is portable, so you could move everything and then remove what you don’t want as a possible workaround.

Regards,
Joe

Actually We have configured new instance to next level now so again copying entire directory and configuring from start will not be possible.

Can I do this?

Copy default blob in which we have all the data in old instance to new nexus server. If yes how can we achieve this?

Regards
Bharat

I’m afraid I don’t understand your reply.
You say something won’t be possible then ask if you can do something?

You can copy the blobstore but also need to copy the database, otherwise you’ll be out of sync, so if you cannot copy the data directory, then the answer is probably no.

While not what you’re asking https://help.sonatype.com/display/NXRM3/Upgrading#Upgrading-Upgradingfrom2.xto3.y may help better explain. The concepts of move and (restoring from) backup are similar…basically the database and blobstore rely on each other, so if you move one, you need to move the other. If you do this but it’s not at the same time, you’ll likely have issues.

-Joe

Thanks for the reply Joe,

I was wondering, if I can copy a single blob (default) from old instance to new one.
But now I understood is that we have to copy the database as well.

So it won’t work in our evironment.

Also, are you aware about any scripts which can be written with respect to rest API and we can download the (maven hosted) repo programatically and uploading it to new repo on new instance ?

I’m not but this question seems to come up, so this a good place, to have asked and/or you might look at older posts to see if anyone has posted them.

Aside from scripting, I have heard proxying can also be a solution (proxy the repo, run the builds, add the proxy with a new hosted to a group, then use the group). Not sure if that will work for you.
-Joe

We wrote, an script using rest api which fetches the artifacts from release repos and uploads it to the new instance.

It works with all repo types, maven, npm, nuget

1 Like

Hi bharat,

Is it possible for you to share the script? that will be a lot helpful for us too.