consolidate \ move some artifacts from a running nexus to another server

1,990 views
Skip to first unread message

Raj P

unread,
Sep 14, 2017, 2:32:58 PM9/14/17
to Nexus Users
we have some npm artifacts on a nexus 3 installed server A 
we have some npm artifacts and all of the maven artifacts on another server B

we would like to bring the artifacts on server A to server B. 

is there a simple way ? 

i think i remember that the only way suggested was to leave the old server A running and point it as proxy from the server B once the cache gets all the artifacts then safely remove the server A. 

any help or pointers appreciated. 

Thank you in advance for your time. 

Jeffry Hesse

unread,
Sep 14, 2017, 2:56:17 PM9/14/17
to Raj P, Nexus Users
This is a way I could see you doing this:


Run that script to list all assets in your npm repo and then use curl to download them to a local folder.


You can use the npm import script from there to push stuff in I believe.

These are community scripts (the second one I wrote), so your mileage may vary, but this might work for you. Let me know how it goes?

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/70986f2b-47f3-41b7-95ee-4e25011cb690%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Raj P

unread,
Sep 14, 2017, 3:15:47 PM9/14/17
to Nexus Users, rp0...@gmail.com
Thank you.

Kelly Robinson

unread,
Sep 14, 2017, 3:17:34 PM9/14/17
to Jeffry Hesse, Raj P, Nexus Users
Other potential paths forward:
- haven't tried this, but presumably it works and is easy to use with your existing npm toolchain? https://www.npmjs.com/package/npm-copy
- you can set up a proxy of server A on server B and proactively request all content to populate the proxy Repository using the existing (beta) REST api. i.e. Iterate over all npm files exposed from server A through the REST api and then request those same packages from server B so your proxy eventually contains all of the same packages. Details of the REST api are documented at http://{nexus host}:{nexus port}/swagger-ui/#!/assets/getAssets

Note that any of these approaches we've discussed are going to have some data changes in terms of publish date, etc., but that shouldn't have any impact on using these packages with npm.

On Thu, Sep 14, 2017 at 11:56 AM, Jeffry Hesse <jhe...@sonatype.com> wrote:
This is a way I could see you doing this:


Run that script to list all assets in your npm repo and then use curl to download them to a local folder.


You can use the npm import script from there to push stuff in I believe.

These are community scripts (the second one I wrote), so your mileage may vary, but this might work for you. Let me know how it goes?
On Thu, Sep 14, 2017 at 11:33 AM Raj P <rp0...@gmail.com> wrote:
we have some npm artifacts on a nexus 3 installed server A 
we have some npm artifacts and all of the maven artifacts on another server B

we would like to bring the artifacts on server A to server B. 

is there a simple way ? 

i think i remember that the only way suggested was to leave the old server A running and point it as proxy from the server B once the cache gets all the artifacts then safely remove the server A. 

any help or pointers appreciated. 

Thank you in advance for your time. 

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.

Mariska

unread,
Oct 31, 2017, 8:49:20 AM10/31/17
to Nexus Users, jhe...@sonatype.com, rp0...@gmail.com
Does anyone know if it is possible to convert a proxy repository to a hosted repository?


On Thursday, September 14, 2017 at 9:17:34 PM UTC+2, Kelly Robinson wrote:
Other potential paths forward:
- haven't tried this, but presumably it works and is easy to use with your existing npm toolchain? https://www.npmjs.com/package/npm-copy
- you can set up a proxy of server A on server B and proactively request all content to populate the proxy Repository using the existing (beta) REST api. i.e. Iterate over all npm files exposed from server A through the REST api and then request those same packages from server B so your proxy eventually contains all of the same packages. Details of the REST api are documented at http://{nexus host}:{nexus port}/swagger-ui/#!/assets/getAssets

Note that any of these approaches we've discussed are going to have some data changes in terms of publish date, etc., but that shouldn't have any impact on using these packages with npm.
On Thu, Sep 14, 2017 at 11:56 AM, Jeffry Hesse <jhe...@sonatype.com> wrote:
This is a way I could see you doing this:


Run that script to list all assets in your npm repo and then use curl to download them to a local folder.


You can use the npm import script from there to push stuff in I believe.

These are community scripts (the second one I wrote), so your mileage may vary, but this might work for you. Let me know how it goes?
On Thu, Sep 14, 2017 at 11:33 AM Raj P <rp0...@gmail.com> wrote:
we have some npm artifacts on a nexus 3 installed server A 
we have some npm artifacts and all of the maven artifacts on another server B

we would like to bring the artifacts on server A to server B. 

is there a simple way ? 

i think i remember that the only way suggested was to leave the old server A running and point it as proxy from the server B once the cache gets all the artifacts then safely remove the server A. 

any help or pointers appreciated. 

Thank you in advance for your time. 

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.

Danny Kulchinsky

unread,
Nov 1, 2017, 11:20:23 AM11/1/17
to Nexus Users, jhe...@sonatype.com, rp0...@gmail.com
Hi Mariska,

I asked this question before, unfortunately the answer is... no :-(

Danny

Michael Worthington

unread,
Nov 1, 2017, 12:08:09 PM11/1/17
to Danny Kulchinsky, Nexus Users, Jeffry Hesse, rp0...@gmail.com
What is the need for converting it to a hosted repo?

If the remote site is no longer available, and you don't want Nexus to check for it, but still need the components available, you can set the Proxy repo to "Manually Blocked".



To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.

Mariska

unread,
Nov 1, 2017, 12:41:15 PM11/1/17
to Nexus Users, dann...@gmail.com, jhe...@sonatype.com, rp0...@gmail.com
The need would be to support a complete migration and end up with only one hosted repository instead of a new hosted repository and a proxy repository which is a mirror of the old instance. But your solution will also work. Thanks.

sebasti...@googlemail.com

unread,
Sep 12, 2018, 3:47:28 AM9/12/18
to Nexus Users, dann...@gmail.com, jhe...@sonatype.com, rp0...@gmail.com
Had the same situation - needed to migrate artifacts to another machine (Nexus 3 OSS to Nexus 3 OSS) and came up with the following: https://github.com/metallaw/scripts/blob/master/nexus_copy_artifacts.sh 
Reply all
Reply to author
Forward
0 new messages