user2779221
user2779221

Reputation: 135

Migration of artifacts from sonatype nexus to new sonatype nexus

I am completely new to maven and migration of artifacts aslo.My environment has two nexus repoes.

Nexus Repo A:
   projrelases proxy(type)
   projsnapshots proxy(type)

Nexus Repo B:
  projrelases hosted(type)
   projsnapshots hosted(type)

These maven repos needs to be migrated to new nexus repo(Nexus Repo C).

Please help.

Upvotes: 5

Views: 8691

Answers (2)

sebge2
sebge2

Reputation: 403

I tried to copy my store to the new one and then synchronize it (see https://github.com/samrocketman/nexus3-config-as-code). All artifacts have not been copied.

I ended up by creating my own script (see https://gist.github.com/sebge2emasphere/497cb264b32ac39a80864c864d522906). The idea is to loop over all property files in the store. Those properties contain the name of the repository and the associated file name. It just downloads it (with CURL) and then uploads it (also with CURL). All artifacts have been copied (and faster).

Upvotes: 1

Manfred Moser
Manfred Moser

Reputation: 29912

You can either just copy the content for each repo after creating it on the target server from sonatype-work/nexus/storage or use rsync to the new server after you have configured it.

Migrate each repository into its own repository on the new target server and then use repository groups to merge them and expose them to the users.

Check out the migration info in the Nexus book as well as our support page for failover for more tips.

Upvotes: 1

Related Questions