amazon-web-servicesnpmverdaccioaws-codeartifact

Move all packages from private npm verdaccio to AWS CodeArtifact


We are using self hosted http://verdaccio.org as a private npm registry. Now we decided to move to managed AWS CodeArtifact. According to what I understand from documentation, AWS CA can only upstream to a public registry (as npmjs.com).
My question is how can I migrate all my packages including all it's versions from a private npm to AWS CA?

Thank you in advance, Oleksii.


Solution

  • Any generic migration steps from npm repository A to npm repository B should work when the destination is CodeArtifact.

    I had success with a utility called 'pkgmigr8or' 1

    Steps to migrate 'chalk-pipe' package from 'npmjs' to 'CodeArtifact':

    1. Create a 'packages.txt' file

       $ cat packages.txt
       chalk-pipe
      
    2. Login to CodeArtifact:

       $ aws codeartifact login --tool npm --repository npm-store --domain my-domain --domain-owner 123456789012
      
    3. Make sure you have authentication info for both repository in '~/.npmrc' if the source is also a private repository

    4. Install pkgmigr8or

       # npm install -g pkgmigr8or
      
    5. Migrate all versions of the package(s):

       $ pkgmigr8or packages.txt https://my-domain-123456789012.d.codeartifact.us-east-1.amazonaws.com/npm/npm-store/
      

    Other similar projects: