0

Does anybody have a process for porting from Sinopia to Nexus 3? We could always proxy Sinopia in Nexus and let it continue to run for a year, but I'd rather import and shut Sinopia down.

Thanks in advance,

Dave B.

Dave Brunkow
  • 352
  • 6
  • 20
  • Sinopia does store modules as .tar.gz files. I may be able to extract all of those and script a publish. – Dave Brunkow Mar 09 '17 at 16:35
  • Are you bound to NX3 right away? I wonder if it's possible to move the files to NX2 then upgrade your NX2 to NX3. NX2 has a flat file system unlike NX3 which uses the blobstore so I imagine you could just copy your files to a repo in NX2 then upgrade. – joedragons Mar 16 '17 at 21:04

1 Answers1

2

Generate List of sinopia tgz files

find $SINOPIA_HOME/storage/ -name "*.tgz" > listoftgzs.txt

Iterate list and publish to Nexus 3

while read p; do
  echo $p
  npm publish $p --registry https://mynexus.hostname.com/repository/npm-internal/ 
done < listoftgzs.txt

I have some failing to publish, which I think has more to do with the module than the method here.

Dave Brunkow
  • 352
  • 6
  • 20
  • I could have combined both sets of commands, but wanted to validate before I ran it. – Dave Brunkow Mar 13 '17 at 20:09
  • 1
    Failed to publish because they had ` "publishConfig": { "registry": "http://npm.server.com/" }, ` in the package.json which overrides the --registry from the command line publish, doh! – Dave Brunkow Mar 15 '17 at 15:02
  • 1
    Appears as though Nexus 3 doesn't support a sinopia proxy as well. – Dave Brunkow Mar 15 '17 at 15:04
  • 1
    Hey there Dave, interesting that Nexus 3 won't proxy Sinopia (I'd love to know more, personally, if you got stack traces etc... pop over to https://issues.sonatype.org/browse/NEXUS ). Also this script might be fairly helpful to others, if you want to add it the Nexus Exchange, pop on over to: http://exchange.sonatype.com/ – DarthHater Mar 16 '17 at 20:43
  • I have so far failed in an attempt to copy sinopia tgz files under Nexus 2 storage directory so I could then upgrade that to Nexus 3. Had to create a directory named "-" and move the tgz file to it. Package.json formats then appeared to be somewhat different. So far haven't even gotten non-scoped package to install after moving over from sinopia. I'm doing what Darth suggests and opening a ticket regarding Nexus 3 and Sinopia. – Dave Brunkow Mar 20 '17 at 21:01
  • I was able to get Sinopia proxied to Nexus3 on a single test server. My issues appear to be network related. While I can curl the Sinopia server successfully from the Nexus3 server, the proxy does not work in our environment calling from the Nexus3 to the Sinopia server. Either way, Sinopia should work. – Dave Brunkow Mar 21 '17 at 15:37