Giter Club home page Giter Club logo

nexus2artifactory's Introduction

⚠️ DEPRECATED - NexusToArtifactory

The JFrog NexusToArtifactory migrator has been deprecated and replaced with the new Nexus to Artifactory Migrator tool. To learn more about the new tool, and to download and use it, see Migrating from Sonatype Nexus Repository to Artifactory


This tool is designed to ease the transition from Sonatype Nexus to JFrog Artifactory. It provides a simple wizard-like interface that allows you to easily configure and run a migration of repositories, artifacts, users, and settings from a Nexus instance to an Artifactory instance.

Currently, the following data can be migrated:

  • local (hosted), remote (proxy), and virtual (group) repositories
    • note that Bower repositories are not yet supported
  • artifacts stored in local (hosted) repositories
    • artifacts stored in remote caches are NOT currently migrated
  • users, groups (roles), and permissions (privileges)
  • LDAP configurations

Note that due to limitations in the REST API in Artifactory OSS, this tool can only migrate to licensed Artifactory distributions (Pro, Enterprise, etc). It does not work with free distributions (OSS, CE, etc).

Installation

This tool accesses the Nexus instance directly by reading the Nexus files from the disk. Therefore, the tool should be installed on the computer running the Nexus instance, or on a computer with access to the filesystem that the Nexus instance is installed on.

First, install the latest version of Python 2. Then, download or clone this repository.

Windows Installation

This tool's interface uses the ncurses library, which is standard in Linux and MacOS, but not readily available in Windows. Instead, the tool can use the PDCurses library as an alternative. This means that Windows users must also have the latest version of PDCurses to run the tool.

Alternatively, Windows users may avoid installing any dependencies by downloading the self-contained exe file.

Usage

To run the tool, run ./NexusToArtifactory.py.

If using the included Windows exe file, instead run NexusToArtifactory.exe.

Using Docker

This tool can be run as a docker container also. We can achieve it using the following command

docker run -it -v <Sonatype-WorkDir>:<Mount-Folder> dropbox-jfrog-support-public-docker.jfrog.io/nexus2artifactory

Since Nexus data directory needs to be provided for the migration process, for a docker setup we need to mount the Nexus work directory to a folder within the container. Further, we will be providing the mounted directory inside the container as Nexus Data Directory while setting up the environment for migration.

Main Menu Screenshot

All options can be accessed by typing the appropriate key on the keyboard. The following options are available:

  • i Initial Setup - Connect to the Nexus and Artifactory instances. This allows the tool to scan both, and come up with a default configuration for migration. This configuration can then be modified via the other options.
  • r Repository Migration Setup - Allows you to specify which repositories should and should not be migrated. Also, allows you to modify any repository to some degree (changing the name, description, layout, etc). These changes only affect the current configuration, and will take effect on the Artifactory instance when the migration is run (the Nexus instance does not change).
  • u Security Migration Setup - Migration options for security data, such as users, groups, permissions, and LDAP configurations.
  • s Save Config JSON File - Allows you to save the current configuration to a JSON file. This way, you can close the tool and come back to it later, or you can save the current state of the migration to revert back to at a future time.
  • l Load Config JSON File - Allows you to load a JSON file containing a configuration.
  • v Verify Configuration - Rescan the Nexus and Artifactory instances, and reapply the current configuration. This should be used to check for incompatibilities after the Nexus instance has been modified.
  • x Run Migration - Run the migration.
  • h Help - Pressing another key after this one displays context-sensitive help for that option.
  • q Exit - Quit the tool.

The first step is to connect to the Nexus and Artifactory instances, so type i to open the Initial Setup menu.

Setup Menu Screenshot

The following options are available:

  • n Nexus Data Directory - The local filesystem path, where the Nexus instance is installed. This is generally a sonatype-work/nexus/ folder. This path can be either a relative or absolute file path. If the path doesn't exist, or if it doesn't contain a valid Nexus install, this option will be hilighted in red.
  • a Artifactory URL - The URL of the Artifactory instance. If the given URL is not a valid Artifactory instance, this option will be hilighted in red.
  • u Artifactory Username - The username of an admin user on the given Artifactory instance.
  • p Artifactory Password - The password of the admin user. Unless both the username and password are correct, they will both be hilighted in red.
  • h Help - Pressing another key after this one displays context-sensitive help for that option.
  • q Back - Go back to the main menu.

When a Nexus 3 path is specified, three new options will appear below it, allowing you to input the Nexus URL, username, and password. This is because Nexus 3 does not make all of its data available on the filesystem like Nexus 2 does, so the tool must connect to the instance to retrieve some of the information.

Note: For Windows 10 (DOS command window) that is running behind a proxy, install CNTLM to point to the proxy and set WinHTTP to point to the local CNTLM and then run theNexusToArtifactory.exe to avoid connectivity issues to Artifactory server.

Setup Menu Screenshot With Filled Options

Once the Nexus and Artifactory instances have both been successfully connected, type q to go back to the main menu.

Main Menu Screenshot With Error

  • If you receive an error while connecting to Nexus, for 3.21.2 Nexus disabled the scripting related features for security reasons. This affects scripts as used through the Script REST API. This line should be added to $data-dir/etc/nexus.properties: nexus.scripts.allowCreation=true in order to resolve that and allow the API.

By this point, the tool has generated an initial configuration for the migration, and all the settings have been set accordingly, but sometimes the default settings need to be modified further. If there are any settings that need to be changed, the corresponding option will be marked with a red !. These must be cleared before running the migration.

In the screenshot above, there is an error in the Repository Migration Setup menu, so type r to enter that menu.

Repo Menu Screenshot With Error

The following options are available:

  • 1 releases (maven) - Typing a number key toggles whether to migrate the associated repository. The plus sign appears when the repository is to be migrated. This option also displays the package type, as well as whether the repository is a (local), [remote], <shadow>, or {virtual}. If there are a lot of repositories to show, they can be paged through using the left and right arrow keys.
  • f Search Filter - Filter the repository list, displaying only repositories that match part of the filter string. This allows for easier browsing and editing of large lists of repositories.
  • m Mass Edit - Allows editing of many repositories at once. Any fields set in the mass edit menu will overwrite existing values on all repositories that match the current search filter.
  • e Edit Repository - Typing e followed by a number allows you to edit the associated repository.
  • h Help - Pressing another key after this one displays context-sensitive help for that option.
  • q Back - Go back to the main menu.

The error turns out to be in the central-m1 repository, so type e and then 6 to edit that one.

Repo Edit Screenshot With Error

The following options are available:

  • Repo Name (Nexus) - The repository's name on the Nexus instance. Not editable.
  • n Repo Name (Artifactory) - The repository's name on the Artifactory instance. Defaults to the Nexus repository name.
  • m Migrate This Repo - Whether to migrate this repository. This is the same as typing the associated number in the repository list menu.
  • Repo Class - Whether the repository is local, remote, shadow, or virtual. Not editable.
  • Repo Type - The repository's package type. Not editable.
  • d Repo Description - The repository description. Defaults to the "display name" of the repository on the Nexus instance.
  • l Repo Layout - The layout of the repository. Defaults to the default layout for the repository's package type.
  • r Handles Releases - Whether this repository handles releases. Local and remote repositories only.
  • s Handles Snapshots - Whether this repository handles snapshots. Local and remote repositories only.
  • p Suppresses Pom Consistency Checks - Whether this repository disables checking for inconsistencies with pom files before allowing artifacts to be deployed. Local and remote repositories only.
  • x Max Unique Snapshots - The maximum number of unique snapshot versions. Local and remote repositories only.
  • b Maven Snapshot Version Behavior - The behavior of snapshots in this repository. Local repositories only.
  • u Remote URL - The URL of the repository this one proxies. Remote repositories only.
  • h Help - Pressing another key after this one displays context-sensitive help for that option.
  • q Back - Go back to the repository list menu.

The error shows that the repository's class, shadow, is invalid. There are a handful of reasons that an initial configuration might not be valid:

  • A Nexus repository, user, or role (group) has a name that would be invalid in Artifactory.

  • A Nexus "shadow repository" is marked for migration. These cannot be migrated, as Artifactory does not have an equivalent concept.

  • The anonymous user is marked for migration. This is a special user in Artifactory, and attempting to migrate it can break things.

  • The default user password is not set. Passwords in Nexus are hashed, and so are impossible to migrate. The solution this tool uses is to set all user passwords to the same default password, and then expire all of them, so the user is forced to enter a new password when they first log in. This behavior can be overridden on a per-user basis by setting the password field for each user directly.

  • A user marked as an administrator does not have the password field set. For security reasons, the tool will not allow an admin user to be set with an expired default password. All admin passwords must be entered manually.

  • A user not marked as an administrator has administrator privileges. In Nexus, there are many special built-in privileges that allow access to various aspects of the Nexus system. All of these privileges fall into one of three categories:

    • The privilege allows access to something that doesn't exist in Artifactory.
    • The privilege allows access that all Artifactory users already have.
    • The privilege allows access that only Artifactory admins have.

    The former two types are ignored. If a user has the third type of privilege, they must also be marked as an administrator.

Since the central-m1 repository is a shadow, it can't be migrated, so it must be unmarked. Type m to unmark it, and then type q to go back to the repository list. Alternatively, type q to go back to the list, and then type 6 to unmark the repository.

Repo Menu Screenshot

Now, the error is gone. The error has disappeared on the main menu as well, and the migration can now be run.

Search Filters

When viewing a very large list of items (repositories, users, groups, etc), it can be helpful to only work on a subset of that list with certain properties, search for a specific item, etc. The Search Filter key (f) can be used to narrow down the list to only the items you want to see. This can make it easier to find the items you want to modify. Alternatively, you can batch-update all items that match the filter using the Mass Edit key (m).

The search filter is a string consisting of any number of space-separated terms. The filter will match any item that matches all of those terms; it will filter out all items that do not match at least one term. A term can be a part of an item's name, or a property=value pair (not all properties are currently supported, but will be eventually). For example, to view only hosted maven repositories with a name containing "devel", the search filter would be:

devel class=local type=maven

The following term types are currently supported:

Term Description Example
<text> A matching item's name includes <text>. devel
type=<type> A matching repository's package type is <type>. type=docker
class=<class> A matching repository is local, remote, or virtual. class=remote

More property term types will be supported in the future. Other ways to combine terms (OR and NOT operators, grouping, etc) will probably be supported in the future.

Options

This tool can optionally write logs to a file. This is primarily useful for debugging purposes. Logging can be configured using the following commandline options:

  • -l, --log-file: Specify a file to write logs to. If the file already exists, the log session is appended to the existing contents. If this option is not given, no logging is performed.
  • -v, --log-level: Specify the minimum log level. All logs below this level are ignored. Possible values are error, warning, info, and debug. If this option is not given, it defaults to info.

This tool can also be run programmatically, provided that a valid migration configuration JSON has already been generated. This can be configured using the following commandline options:

  • -f, --load-file: Select a config JSON file to load immediately. This can be used in interactive mode, and is equivalent to using the l option on the tool's main screen. In non-interactive mode, this option is required.
  • -n, --non-interactive: Run the tool in non-interactive mode. This loads the config JSON specified by -f, and immediately runs migration. If the config JSON was invalid or the migration had errors, the tool returns nonzero.
  • -q, --silent: By default, non-interactive mode prints logs to stdout, as well as the file optionally specified by -l. If -q is passed, no logs are printed.

Other commandline options are as follows:

  • -r, --retries: When migrating artifacts, a deploy might fail for some ephemeral reason (conflicts with in-progress metadata calculation, network issues, etc). This specifies the maximum number of times the tool will attempt to deploy each artifact before migration of that artifact fails. Default is 3.
  • -t, --threads: The number of threads used to migrate artifacts. Default is 4.
  • -s, --ssl-no-verify: Disable SSL verification. This is useful if your Artifactory and/or Nexus 3 instance uses a self-signed SSL certificate.
  • -o, --force-tls10: Forces TLSv1.0 to be used when HTTPS is used. Some SSL libraries have a bug that prevents them from properly using TLSv1.1 or later. If you have trouble connecting with HTTPS, try enabling this.
  • -d, --disable-security-migration: Disables migration of users, groups (roles), and permissions (privileges). This can improve the speed of use if only repositories are to be migrated.
  • -h, --help: Print help message, which describes all of these options.

Testing

This project uses Python's unittest framework. To run the tests, you can use your favorite IDE, or run them from the command line.

To run the unit tests from the command line (requires Python 2.7):

cd nex2art/tests
python -m unittest discover -v -p "*Test.py"

Future Development

This tool is currently incomplete, and plenty of features are not yet implemented. The following is a list of features that are currently in development, and should be added to the tool soon:

  • migrate Bower repositories
  • migrate to Artifactory SaaS instances
  • migrate scheduled tasks
  • migrate other instance-wide settings (email settings, proxy settings, etc)
  • support paid Nexus features, such as custom metadata
  • modify virtual repository child lists
  • modify repository package types

Nearly everything the tool does not yet migrate can be fixed manually via the Artifactory user interface, after the migration is complete. A major exception to this is if the tool chooses the wrong package type for a repository. If a package type needs to be fixed after migration, packageType.py might help.

nexus2artifactory's People

Contributors

akeemmyu avatar darthfennec avatar divijakandukoori avatar jbaruch avatar jchharris avatar jfrogprasanna avatar robinino avatar shahiinn avatar smasherr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nexus2artifactory's Issues

Nexus OSS 3.13.0-01 connection problems

Hi,
When I'm configuring script to start migration, I got green on data directory, then green on url, user and password, but data directory turns red.
I have run script with logging and I see few errors, but I think most important are

2019-07-17 17:40:51,376 [MainThread] [ERROR] (nex2art.core.Nexus3:239) - Error connecting to Nexus:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>
Traceback (most recent call last):
  File "/var/lib/docker/volumes/prod_nexus_data/_data/nexus2artifactory/nex2art/core/Nexus3.py", line 235, in dorequest
    else: resp = urllib2.urlopen(req)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 411: Length Required
2019-07-17 17:40:41,022 [MainThread] [ERROR] (nex2art.core.Nexus3:239) - Error connecting to Nexus:
Traceback (most recent call last):
  File "/var/lib/docker/volumes/prod_nexus_data/_data/nexus2artifactory/nex2art/core/Nexus3.py", line 235, in dorequest
    else: resp = urllib2.urlopen(req)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 635, in http_error_302
    new = self.redirect_request(req, fp, code, msg, headers, newurl)
  File "/usr/lib64/python2.7/urllib2.py", line 596, in redirect_request
    raise HTTPError(req.get_full_url(), code, msg, headers, fp)
HTTPError: HTTP Error 302: Found

What is more important, Nexus is configured with Azure Active Directory so there might be some issue with redirect links (even that I have provided local admin account to login).
Nexus instance is installed from sonatype/nexus3 docker image.

Unable to connect to Artifactory

Screen Shot 2020-01-28 at 3 06 52 PM

I am unable to connect the Artifactory instance even though I have copy pasted all credentials. I am using Python 3 if that makes a difference. Also our subscription type is Cloud Pro X

Issue was found on CentOS

I got below error when running the script. My system is a CentOS 6.2 server. However the script seems wrongly recognised my system as a windows. And therefore, it is looking the PDCurses library.

[root@localhost nexus2artifactory-master]# ./NexusToArtifactory.py
Fatal error: this platform is not supported by UniCurses (either you're running a very old Python distribution below v2.6, or you're using an exotic operating system that's neither Win nor *nix).

Traceback (most recent call last):
File "./NexusToArtifactory.py", line 4, in
import unicurses
File "/root/Downloads/nexus2artifactory-master/unicurses.py", line 50, in
raise ImportError("UniCurses initialization error - unsupported platform.")
ImportError: UniCurses initialization error - unsupported platform.

[root@localhost nexus2artifactory-master]# python --version
Python 2.7.14

Logging

Hi @DarthFennec ,

Quick question about Run the migration". During the migration process certain artifacts might errors during the transfer. Ids there any logging that might give me some detail on what artifacts had errors and why?

Issue migrating N3 to Artifactory

Hello!
Currently I`m facing am issue when try to migrate Nexus3 to Artifactory.
2018-05-30 09:52:02,983 [MainThread] [INFO] (nex2art.core.Nexus3:167) - Successfully fetched Nexus data.
2018-05-30 09:52:02,983 [MainThread] [INFO] (nex2art.core.Nexus3:58) - Successfully read repository config.
2018-05-30 09:52:02,983 [MainThread] [INFO] (nex2art.core.Ldap3:12) - Reading LDAP config from Nexus.
2018-05-30 09:52:02,983 [MainThread] [INFO] (nex2art.core.Ldap3:16) - Successfully read LDAP config.
2018-05-30 09:52:02,983 [MainThread] [INFO] (nex2art.core.Security3:60) - Reading security config from Nexus.
2018-05-30 09:52:02,986 [MainThread] [ERROR] (nex2art.core.Security3:95) - Error reading security config:
Traceback (most recent call last):
File "/home/ykochubey/nexus2artifactory-master/nex2art/core/Security3.py", line 73, in refresh
roledata = self.getrole(role, privmap)
File "/home/ykochubey/nexus2artifactory-master/nex2art/core/Security3.py", line 135, in getrole
for priv in role['privileges']: privs.append(privmap[priv])

Here is the short trace.

Get permissions of Nexus repositories

Hi, I found no available permissions on the tool.
It seems this tool only recognizes privileges which are created by user.
Is there any way to get basic-which is auto created when you set the repo- privileges of Nexus?

dockerinfo missing

Hi,
I am trying to migrate a docker repo and noticed that once the migration completed...my docker images dont have "docker-info" tab populated on the UI.
Any suggestions why that would be happening?
Thanks

Users Migration Setup

I'm trying to migrate from the latest Nexus 2 to the latest Artifactory pro using the 30 day trial as proof of concept for my company.

So when using the tool per instructions Security Migration setup is telling me that edits need to be made.
image

Then when I step into security Migration set up the following needs to be edited.
image

When looking at my user that need to have edits, they all seem to have email and password fields in need of editing. How am i supposed to get around this when i check Nexus2 and the users have emails associated with them but don't seem to get pulled into the migration tool, also looks like it wants me to edit their passwords too! Not sure if this is a Nexus2 config issue since ldap is being used or just a tooling issue. Please advise and thank you in advance.

ImportError

I downloaded NexustoArtifactory tool on the instance where Nexus is installed, but im unable to run ./NexustoArtifactory.py. Getting issue while importing argparse. Please help me resolve this issue. Thanks.

image

sec group

Hello,
We have installed nexus2artifactory tool on server where Nexus is installed. Python version is 2.6. But we are getting error "Configuration file security.xml is not valid."

Nexus path provided is: sonatype-work\nexus (where exactly conf folder is available and inside it security.xml is available)

Could you please help us with above error.

Regards,
Chandrasekhar

Repos are Created, but Artifacts do not Migrate

I have configured the tool and it connects to Artifactory. It migrates the Users and the Repos, but when it tries to migrate the Artifacts, they all fail.

In my logs, I see a lot of calls to repo names that don't exist.

For example, one of the repos I'm migrating is named snapshots. In my logs, I see a lot of PUT calls to URIs like

  • snapshotsz
  • snapshotsm
  • snapshotsl
    etc.

These bogus URI calls all return HTTP 403. I never see any calls to PUT or POST actual artifacts in the actual "snapshots" repo.

Again, the repos have been created by the tool. Connectivity works. Permissions work.

+ Repositories 2/2
+ Groups 0/0
+ Users 2/2
+ Permissions 0/0
+ LDAP Configs 0/0
! Artifacts 3407 Total, 3407 Errors
+ Finalizing 2/2

Issue with "handle release/snapshot" option

Hi,

There is a bug (regression) with the option "handles releases", "handles snapshots" and "check pom consistency". Whatever value you chose, the three boxes are ticked at repository creation on Artifactory.

This wasn't the case before.

Version of nexus2artifactory used: branch master at time of writing (commit )
Version of nexus used: Nexus Repository Manager OSS 2.14.3-02
Version of artifactory used: Artifactory Professional 5.8.3 rev 50803900

Thank you in advance for your help

Initial setup

Hi

I have a nexus3 repo. I start the app and go to the inital setup, I then put in the nexus data directory. The inputted-text goes green then asks me for three other fields:

  • Url

  • Nexus Username

  • Nexus Password

I enter these three fields and each of them turn green. However at this point the data-directory field turns red. If I then remove the url, the data-directory returns to green. It seems I can only have one or the other (be green)?

Any ideas?
Thanks
Sean

image

image

https connection to artifactory not possible

hi all

i cannot connect to my artifactory instance via https:


2017-08-22 13:53:25,763 [MainThread] [INFO] (nex2art.menu.Setup:53) - Sending request to https://artifactory.blabla.bl/artifactory/api/system/ping.
2017-08-22 13:53:26,591 [MainThread] [ERROR] (nex2art.menu.Setup:63) - Error connecting to Artifactory:
Traceback (most recent call last):
  File "E:\apps\nexus2artifactory\nex2art\menu\Setup.py", line 56, in pingserver
    resp = urllib2.urlopen(req)
  File "E:\apps\Python27\lib\urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "E:\apps\Python27\lib\urllib2.py", line 429, in open
    response = self._open(req, data)
  File "E:\apps\Python27\lib\urllib2.py", line 447, in _open
    '_open', req)
  File "E:\apps\Python27\lib\urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "E:\apps\Python27\lib\urllib2.py", line 1241, in https_open
    context=self._context)
  File "E:\apps\Python27\lib\urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>
2017-08-22 13:53:26,592 [MainThread] [INFO] (nex2art.menu.Setup:84) - System ping completed, status: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661).

any ideas?
regards angela

nexus3 migration blobstore failure

While trying to run a migration from nexus3 to artifactory on an npm repository the script consistently fails with a rather unuseful error. I have looked at the code to try to diagnose the issue, but I am not a python dev at all and couldn't find any reason why it is dieing on this.

Traceback (most recent call last):
File "./NexusToArtifactory.py", line 70, in
else: initInteractive(setup)
File "./NexusToArtifactory.py", line 27, in initInteractive
win.show()
File "/home/chris/nexus2artifactory/nex2art/core/Menu.py", line 179, in show
if self.runact(sel, sel['act']): return
File "/home/chris/nexus2artifactory/nex2art/core/Menu.py", line 203, in runact
elif hasattr(act, 'call'): cont = self.showCall(sel, act)
File "/home/chris/nexus2artifactory/nex2art/core/Menu.py", line 223, in showCall
cont = act(sel)
File "/home/chris/nexus2artifactory/nex2art/menu/Main.py", line 64, in runmigration
status, msg = Progress(self.scr).show(self.scr.state.todict())
File "/home/chris/nexus2artifactory/nex2art/core/Progress.py", line 30, in show
result = self.scr.artifactory.migrate(self, conf)
File "/home/chris/nexus2artifactory/nex2art/core/Artifactory.py", line 85, in migrate
self.upload.upload(conf)
File "/home/chris/nexus2artifactory/nex2art/core/Upload.py", line 67, in upload
for f in self.filelistgenerator3(conf): queue.put(f)
File "/home/chris/nexus2artifactory/nex2art/core/Upload.py", line 171, in filelistgenerator3
if self.isNexus3ChecksumFile(chapdir, blobbase): continue
File "/home/chris/nexus2artifactory/nex2art/core/Upload.py", line 413, in isNexus3ChecksumFile
blobname = self.acquireMetadata3(blobpropertiesfile)['@BlobStore.blob-name']
KeyError: '@BlobStore.blob-name'

UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)

Got this error when running a migration:

$ python nexus2artifactory/./NexusToArtifactory.py Traceback (most recent call last): File "nexus2artifactory/./NexusToArtifactory.py", line 70, in <module> else: initInteractive(setup) File "nexus2artifactory/./NexusToArtifactory.py", line 27, in initInteractive win.show() File "/root/nexus2artifactory/nex2art/core/Menu.py", line 179, in show if self.runact(sel, sel['act']): return File "/root/nexus2artifactory/nex2art/core/Menu.py", line 203, in runact elif hasattr(act, '__call__'): cont = self.showCall(sel, act) File "/root/nexus2artifactory/nex2art/core/Menu.py", line 223, in showCall cont = act(sel) File "/root/nexus2artifactory/nex2art/menu/Main.py", line 64, in runmigration status, msg = Progress(self.scr).show(self.scr.state.todict()) File "/root/nexus2artifactory/nex2art/core/Progress.py", line 30, in show result = self.scr.artifactory.migrate(self, conf) File "/root/nexus2artifactory/nex2art/core/Artifactory.py", line 64, in migrate if counts['group'] > 0: self.migrategroups(conn, conf) File "/root/nexus2artifactory/nex2art/core/Artifactory.py", line 349, in migrategroups self.prog.refresh() File "/root/nexus2artifactory/nex2art/core/Progress.py", line 50, in refresh self.render() File "/root/nexus2artifactory/nex2art/core/Progress.py", line 110, in render unicurses.waddstr(self.scr.win, self.current + "\n") File "/root/nexus2artifactory/unicurses.py", line 766, in waddstr return scr_id.addstr(str(cstr)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)

Chinese is not supported

When the LDAP group information name is in Chinese, it will directly report an error and exit

Add summary output even for less verbose options

Some users need the Nexus2Artifactory script to run quickly without much output, but need the summary to validate the migration was successful.

The "info" log level can slow the script as it has to print each event to the log file.

The script should print out a summary to the standard output or log file even if the -v warn or -v error log level is specified.

why upload pom.xml or .pom files after other files?

class Maven(object):
    def __init__(self):
        self.lock = threading.Lock()
        self.poms = []

    def deployPaths(self, localpath, metapath, repo, repopath):
        fname = os.path.basename(repopath)
        if fname == 'pom.xml' or fname.endswith('.pom'):
            pom = localpath, metapath, repo, repopath
            with self.lock: self.poms.append(pom)
            return []
        return [(localpath, metapath, repo, repopath, {})]

    def cleanup(self):
        for localpath, metapath, repo, repopath in self.poms:
            yield localpath, metapath, repo, repopath, {}

Since items are only appended to self.poms and never deleted, when I run migration repeatedly, the same pom file will be uploaded multiple times.

Error reading repository config

We have Nexus 3 installed as a container. The data directory where blobs cache DB etc ... Is mounted to the same server the container run on.
When running the nexus2art and passing the mount path as Nexus directory I get this error :
"Error reading repository config"
We tried everything with no results ...
We tried to run nexus2art inside the container but got error in screen.py
When it tries to create border saying int does not have attribute border in universes.py line 854
Thanks in advance

migration failing

trying to migrate a test repo from Nexus (v. 2.11.2 ) to Artif (v 4.10.0)

from log,


[nexus@njc02 nexus2artifactory-master]$ cat mylog 
============================================================

Nexus To Artifactory Migration Tool

============================================================

2016-10-31 15:46:12,431 [MainThread] [INFO] (root:14) - Initializing Nexus migration tool.
2016-10-31 15:46:12,438 [MainThread] [INFO] (nex2art.menu.Setup:41) - Sending system ping to Artifactory.
2016-10-31 15:46:12,439 [MainThread] [INFO] (nex2art.menu.Setup:83) - System ping completed, status: None.
2016-10-31 15:46:17,784 [MainThread] [INFO] (nex2art.menu.Main:111) - Loading configuration from file mrx.
2016-10-31 15:46:17,838 [MainThread] [INFO] (nex2art.core.Nexus:28) - Reading Nexus config from /data/sonatype-work/nexus/conf/nexus.xml.
2016-10-31 15:46:17,851 [MainThread] [INFO] (nex2art.core.Nexus:53) - Successfully read Nexus config.
2016-10-31 15:46:17,851 [MainThread] [INFO] (nex2art.core.Ldap:15) - Reading LDAP config from /data/sonatype-work/nexus/conf/ldap.xml.
2016-10-31 15:46:17,852 [MainThread] [INFO] (nex2art.core.Ldap:19) - Successfully read LDAP config.
2016-10-31 15:46:17,852 [MainThread] [INFO] (nex2art.core.Security:29) - Reading security config from /data/sonatype-work/nexus/conf/security.xml.
2016-10-31 15:46:17,855 [MainThread] [INFO] (nex2art.core.Security:50) - Successfully read security config.
2016-10-31 15:46:17,855 [MainThread] [INFO] (nex2art.menu.Setup:41) - Sending system ping to Artifactory.
2016-10-31 15:46:17,855 [MainThread] [INFO] (nex2art.menu.Setup:53) - Sending request to https://artifactory.mycompany.local/api/system/ping.
2016-10-31 15:46:18,496 [MainThread] [INFO] (nex2art.menu.Setup:83) - System ping completed, status: 200.
2016-10-31 15:46:18,517 [MainThread] [INFO] (nex2art.menu.Main:118) - Configuration loaded successfully.
2016-10-31 15:46:57,666 [MainThread] [INFO] (nex2art.menu.Main:54) - Verifying current state.
2016-10-31 15:46:57,668 [MainThread] [INFO] (nex2art.core.Nexus:28) - Reading Nexus config from /data/sonatype-work/nexus/conf/nexus.xml.
2016-10-31 15:46:57,679 [MainThread] [INFO] (nex2art.core.Nexus:53) - Successfully read Nexus config.
2016-10-31 15:46:57,679 [MainThread] [INFO] (nex2art.core.Ldap:15) - Reading LDAP config from /data/sonatype-work/nexus/conf/ldap.xml.
2016-10-31 15:46:57,680 [MainThread] [INFO] (nex2art.core.Ldap:19) - Successfully read LDAP config.
2016-10-31 15:46:57,680 [MainThread] [INFO] (nex2art.core.Security:29) - Reading security config from /data/sonatype-work/nexus/conf/security.xml.
2016-10-31 15:46:57,682 [MainThread] [INFO] (nex2art.core.Security:50) - Successfully read security config.
2016-10-31 15:46:57,682 [MainThread] [INFO] (nex2art.menu.Setup:41) - Sending system ping to Artifactory.
2016-10-31 15:46:57,682 [MainThread] [INFO] (nex2art.menu.Setup:53) - Sending request to https://artifactory.mycompany.local/api/system/ping.
2016-10-31 15:46:57,702 [MainThread] [INFO] (nex2art.menu.Setup:83) - System ping completed, status: 200.
2016-10-31 15:46:57,705 [MainThread] [INFO] (nex2art.menu.Main:56) - Current state verified successfully.
2016-10-31 15:47:00,372 [MainThread] [INFO] (nex2art.menu.Main:64) - Attempting to run migration.
2016-10-31 15:47:00,375 [MainThread] [INFO] (nex2art.core.Nexus:28) - Reading Nexus config from /data/sonatype-work/nexus/conf/nexus.xml.
2016-10-31 15:47:00,386 [MainThread] [INFO] (nex2art.core.Nexus:53) - Successfully read Nexus config.
2016-10-31 15:47:00,386 [MainThread] [INFO] (nex2art.core.Ldap:15) - Reading LDAP config from /data/sonatype-work/nexus/conf/ldap.xml.
2016-10-31 15:47:00,387 [MainThread] [INFO] (nex2art.core.Ldap:19) - Successfully read LDAP config.
2016-10-31 15:47:00,387 [MainThread] [INFO] (nex2art.core.Security:29) - Reading security config from /data/sonatype-work/nexus/conf/security.xml.
2016-10-31 15:47:00,388 [MainThread] [INFO] (nex2art.core.Security:50) - Successfully read security config.
2016-10-31 15:47:00,389 [MainThread] [INFO] (nex2art.menu.Setup:41) - Sending system ping to Artifactory.
2016-10-31 15:47:00,389 [MainThread] [INFO] (nex2art.menu.Setup:53) - Sending request to https://artifactory.mycompany.local/api/system/ping.
2016-10-31 15:47:00,408 [MainThread] [INFO] (nex2art.menu.Setup:83) - System ping completed, status: 200.
2016-10-31 15:47:00,413 [MainThread] [INFO] (nex2art.core.Artifactory:47) - Migrating to Artifactory.
2016-10-31 15:47:00,414 [MainThread] [INFO] (nex2art.core.Artifactory:53) - Enabling password expiration.
2016-10-31 15:47:00,414 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/system/configuration.
2016-10-31 15:47:00,549 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending POST request to https://artifactory.mycompany.local/api/system/configuration.
2016-10-31 15:47:00,787 [MainThread] [INFO] (nex2art.core.Artifactory:133) - Migrating repository definitions.
2016-10-31 15:47:00,787 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/repositories.
2016-10-31 15:47:01,618 [MainThread] [INFO] (nex2art.core.Artifactory:144) - Migrating repo Install4J -> mrepo_test.
2016-10-31 15:47:01,619 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending POST request to https://artifactory.mycompany.local/api/repositories/mrepo_test.
2016-10-31 15:47:01,695 [MainThread] [ERROR] (nex2art.core.Artifactory:388) - Error making request:
Traceback (most recent call last):
  File "/opt/nexus2artif/nexus2artifactory-master/nex2art/core/Artifactory.py", line 384, in dorequest
    resp = urllib2.urlopen(req)
  File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 409: Conflict
2016-10-31 15:47:01,696 [MainThread] [ERROR] (nex2art.core.Artifactory:168) - Error migrating repository Install4J:
Traceback (most recent call last):
  File "/opt/nexus2artif/nexus2artifactory-master/nex2art/core/Artifactory.py", line 166, in migraterepos
    self.dorequest(conn, mthd, cfg, jsn)
  File "/opt/nexus2artif/nexus2artifactory-master/nex2art/core/Artifactory.py", line 395, in dorequest
    raise MigrationError(msg)
MigrationError
2016-10-31 15:47:01,696 [MainThread] [INFO] (nex2art.core.Artifactory:219) - Migrating groups.
2016-10-31 15:47:01,696 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/security/groups.
2016-10-31 15:47:01,715 [MainThread] [INFO] (nex2art.core.Artifactory:173) - Migrating users.
2016-10-31 15:47:01,715 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/security/users.
2016-10-31 15:47:01,735 [MainThread] [INFO] (nex2art.core.Artifactory:246) - Migrating permissions.
2016-10-31 15:47:01,735 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/security/permissions.
2016-10-31 15:47:01,757 [MainThread] [INFO] (nex2art.core.Artifactory:64) - Resetting password expiration.
2016-10-31 15:47:01,757 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending GET request to https://artifactory.mycompany.local/api/system/configuration.
2016-10-31 15:47:01,892 [MainThread] [INFO] (nex2art.core.Artifactory:382) - Sending POST request to https://artifactory.mycompany.local/api/system/configuration.
2016-10-31 15:47:02,182 [MainThread] [INFO] (nex2art.core.Upload:28) - Uploading artifacts.
2016-10-31 15:47:02,183 [MainThread] [INFO] (nex2art.core.Upload:34) - Creating 4 threads.
2016-10-31 15:47:02,183 [MainThread] [INFO] (nex2art.core.Upload:39) - Threads created successfully.
2016-10-31 15:47:02,184 [MainThread] [INFO] (nex2art.core.Upload:43) - All artifacts successfully uploaded.
2016-10-31 15:47:14,122 [MainThread] [INFO] (nex2art.menu.Main:71) - Migration successfully run.
2016-10-31 15:47:26,357 [MainThread] [INFO] (root:33) - Terminating Nexus migration tool.

ImportError

Traceback (most recent call last):
File "./NexusToArtifactory.py", line 6, in
from nex2art.menu import Safety, Main
File "/home/kubh8003/nexusmigrate/nexus2artifactory-master/nex2art/init.py", line 1, in
from . import core
File "/home/kubh8003/nexusmigrate/nexus2artifactory-master/nex2art/core/init.py", line 7, in
from .Setup import Setup
File "/home/kubh8003/nexusmigrate/nexus2artifactory-master/nex2art/core/Setup.py", line 4, in
import argparse
ImportError: No module named argparse

Only works with Artifactory Pro

When trying to migrate a repository from nexus to artifactory oss the following message can be found in the log:

{
  "errors" : [ {
    "status" : 400,
    "message" : "This REST API is available only in Artifactory Pro (see: http://www.jfrog.com/addons.php). If you are already running Artifactory Pro please make sure your server is activated with a valid license key.\n"
  } ]
}

Should be clear from the beginning that this only works for Artifactory Pro, given that the REST API access for this to work if a premium feature.

Feature: Add repository path filter

Context

In some repositories, it could be a huge amount of uploaded artifacts resulting in a large size repository. On migration time, it could be a problem if you are limited in a time window to do your job.

Solution proposed

Implement the ability to choose the path in the repository you want to migrate. For example, assuming this repository tree:

  • Parent A
    • Child A1
    • Child A2
    • Child A3
  • Parent B
    • Child B1
    • Child B2
    • Child B3
  • Parent C
    • Child C1
    • Child C2
    • Child C3

You could filter by parent path "/B/*" in the repository without take on consideration parent paths "/A" and "/C".

409 doesn't match the POM's

We selected option 'p' i.e. Suppresses Pom Consistency Checks - Whether this repository disables checking for inconsistencies with pom files before allowing artifacts to be deployed. Local and remote repositories only and executed the migration and got below error. Can you please suggest how can I avoid this error.

2019-02-15 13:21:38,542 [Thread-3] [ERROR] (nex2art.core.Upload:244) - Unable to deploy artifact to https://staging.artifacts.excompany.net/artifactory/billing-maven-local/.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom.
2019-02-15 13:21:38,681 [Thread-3] [ERROR] (nex2art.core.Upload:288) - Error deploying artifact checksum:
{
"errors" : [ {
"status" : 409,
"message" : "The target deployment path '.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom' does not match the POM's expected path prefix 'org/springframework/Spring/3.0.0.M3'. Please verify your POM content for correctness and make sure the source path is a valid Maven repository root path."
} ]
}
Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Upload.py", line 282, in deployChecksum
else: stat = urllib2.urlopen(req).getcode()
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 409: Conflict
2019-02-15 13:21:38,683 [Thread-3] [ERROR] (nex2art.core.Upload:244) - Unable to deploy artifact to https://staging.artifacts.excompany.net/artifactory/billing-maven-local/.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom.
2019-02-15 13:21:38,838 [Thread-3] [ERROR] (nex2art.core.Upload:288) - Error deploying artifact checksum:
{
"errors" : [ {
"status" : 409,
"message" : "The target deployment path '.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom' does not match the POM's expected path prefix 'org/springframework/Spring/3.0.0.M3'. Please verify your POM content for correctness and make sure the source path is a valid Maven repository root path."
} ]
}
Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Upload.py", line 282, in deployChecksum
else: stat = urllib2.urlopen(req).getcode()
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 409: Conflict
2019-02-15 13:21:38,839 [Thread-3] [ERROR] (nex2art.core.Upload:244) - Unable to deploy artifact to https://staging.artifacts.excompany.net/artifactory/billing-maven-local/.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom.
2019-02-15 13:21:38,840 [Thread-3] [ERROR] (nex2art.core.Upload:249) - Unable to deploy artifact to https://staging.artifacts.excompany.net/artifactory/billing-maven-local/.nexus/trash/org/springframework/Spring/3.0.0.M3/Spring-3.0.0.M3.pom after 3 retries.
2019-02-15 13:21:42,755 [MainThread] [ERROR] (nex2art.core.Artifactory:582) - Error making request:
{
"errors" : [ {
"status" : 403,
"message" : "Forbidden"
} ]
}
Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Artifactory.py", line 578, in dorequest
else: resp = urllib2.urlopen(req)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
2019-02-15 13:21:42,755 [MainThread] [ERROR] (nex2art.core.Artifactory:263) - Error finalizing migration for repository thirdparty:
Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Artifactory.py", line 261, in migratereposfinalize
self.dorequest(conn, 'POST', cfg, jsn)
File "/root/nexus2artifactory-master/nex2art/core/Artifactory.py", line 589, in dorequest
raise MigrationError(msg)
MigrationError

403 Forbidden Issue

I am trying to transfer a nexus hosted repo to an artifactory local repo and getting 403 forbidden.

2019-02-06 15:58:43,647 [MainThread] [INFO] (nex2art.core.Artifactory:237) - Finalizing repository migrations.
2019-02-06 15:58:43,647 [MainThread] [INFO] (nex2art.core.Artifactory:246) - Finalizing migration for repo maven-releases -> bill-maven-local.
2019-02-06 15:58:43,648 [MainThread] [INFO] (nex2art.core.Artifactory:571) - Sending POST request to https://staging.artifacts.*********desk.net/artifactory/api/repositories/bill-maven-local.
2019-02-06 15:58:43,754 [MainThread] [ERROR] (nex2art.core.Artifactory:582) - Error making request:
{
"errors" : [ {
"status" : 403,
"message" : "Forbidden"
} ]
}

Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Artifactory.py", line 578, in dorequest
else: resp = urllib2.urlopen(req)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

Repository migration with subset of artifacts

We have a mostly-mono releases repository setup in Nexus. In the brave-new-Artifactory world, we are planning on splitting this up into smaller repositories.

Is it possible to migrate a repository based on a content selector (in nexus terminology)? i.e. pull all the artifacts from the releases repository, but only select the com.comany.product-a/**/* artifacts?

This would allow us to do a piecemeal migration, only pulling across a subset of artifacts from a repository into artifactory at a time.

Thanks!

Migrator is throwing error : Configuration file security.xml is not valid.

Hi JFrogDev team,

I am working on migrating user, repositories and all the data inside repositories from nexus 2.x to Artifactory.

I am getting an error in the initial setup screen of the migrator. The error is Configuration file security.xml is not valid.

I am running this on RHEL and python version 2.6.6.

I verified the nexus path and found the security.xml file is a valid file inside config folder inside Nexus Data Directory.


Initial Setup
n: Nexus Data Directory ! /opt/mount1/casfw/nexus2.x/sonatype-work/nexus/

a: Artifactory URL !
u: Artifactory Username !
p: Artifactory Password !

h: Help
q: Back

Configuration file security.xml is not valid.


can you please help me fix this issue and migrate from Nexus to Artifactory

Error in Initial Set up

Hi,
I have installed nexus2artifactory tool on the same server where Nexus is installed. Python version is 2.6.6.

While trying to do initial setup, once 'Nexus Data Directory' details are given, I am getting error "AttributeError: 'NoneType' object has no attribute 'text'"

Nexus path provided is: sonatype-work/nexus

Could you please check on how to resolve this issue.
Error details given below:

Traceback (most recent call last):
File "./NexusToArtifactory.py", line 70, in
else: initInteractive(setup)
File "./NexusToArtifactory.py", line 27, in initInteractive
win.show()
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Menu.py", line 179, in show
if self.runact(sel, sel['act']): return
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Menu.py", line 202, in runact
elif hasattr(act, 'show'): act.show()
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Menu.py", line 179, in show
if self.runact(sel, sel['act']): return
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Menu.py", line 203, in runact
elif hasattr(act, 'call'): cont = self.showCall(sel, act)
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Menu.py", line 223, in showCall
cont = act(sel)
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/menu/Setup.py", line 9, in nx
def nx(_): return self.scr.nexus.checkNexus()
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Nexus.py", line 48, in checkNexus
self._nex2.checkNexus()
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Nexus2.py", line 137, in checkNexus
nx.vpath = self.refresh(newpath)
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Nexus2.py", line 26, in refresh
caps = self.getYumCapabilities(xmlcap)
File "/opt/app/lmadhu/nexus2artifactory-master/nex2art/core/Nexus2.py", line 129, in getYumCapabilities
props[prop.find('key').text] = prop.find('value').text
AttributeError: 'NoneType' object has no attribute 'text'

nexus2art snapshots unique version behavior question

Hi,

First of all, I'd like to say thanks for this tool which is awesome to migrate from Nexus.
However when using it, it looks like the snpashots repository are not properly migrated. I explain my point: created snapshots repository on Artifactory side are created with non-unique as "Maven Snapshot Version Behavior". How could this be changed ? Am I doing it wrong ?

Thank you in advance for your kind explanation

Feature Request / Question

Is it also possible to migration "only" the Security and the Repository Definitions, without migrating the actual Artifacts. So effectively the Artifactory Repo would be initially empty in terms of Artifacts, but would have the "same" user , groups and repository definitions.

nexus2artifactory is not able to access artifactory url

We are trying to migrate data from Nexus to Artifactory using nexus2artifactory tool. We are blocked in the first step itself, in the initial setup menu, while giving the artifactory url, we got the below error:

Unable to access artifactory url. and errors in lines 435,548,473,407,556
HTTP Error 503 : Service unavailable

Artifactory url is accessible in browser and running successfully. But the tool is not able to recognize artifactory. Please let us know if anything needs to be configured for the tool to connect to artifactory.

Broken execution since #6

Hi,

It looks like that since #6 which was proposed by myself, the tool fails silently when migrating maven repository as no default Maven Snapshot Version Behavior is defined and tool needs one.

@DarthFennec: initially in my PR I proposed a value when user didn't set anything (to avoid editing all the repo he wants to migrate) and with your proposal to have a list of chosen value, this was lost making it mandatory to edit all the repos.

I'll propose something as soon as I got a minute

Unable to GET api/system/configuration: 403

I am facing an error when running the migration. It looks like it is related to the authentication perspective My nexus's version is Nexus Repository Manager OSS 2.14.1-01 and the tool doesn't require any authentication. Have anyone seen this error before?

Screen Shot 2020-03-27 at 4 16 06 PM

Initial Setup does not work with nexus.properties file

Hi,

When i try to set the "Nexus Path", i have this error message:
Given path is not a valid Nexus instance.

I think my problem is that the configuration of my nexus instance (version 2.7.0-06) is a nexus.properties file and not nexus.xml.
File : Nexus.py:25->31

Thanks in advance for your explanation or workaround.

Recommendations on number of threads

We've been using nexus2artifactory to migrate quite a large repository (1million artifacts). I run tests using both 4 threads, and 8 threads without any issues.

Do you have any recommendations on the number of threads to use? I know it's going to be system dependent (how long is a piece of string and all that), but is there a way we can determine roughly how hard we can or should push the thread count before anything bad starts happening; more over, is the threads limited purely by the source nexus system's capacity or the target artifactory instance?

Thanks!

Add filtering on repository listing

We have many pages of repositories in listing and it would help to have some kind of filtering feature.
For instance in repository setup, a "f" command may ask for a word wich is then used to limit view in size, only showing matching repository names.

Dockerized Nexus3 to ArtifactoryPro

Trying to use the migration tool on a machine that has a dockerized Nexus running on it. The Dockerized nexus is bind mounted to a local directory outside the container. Lets say the absolute path to that bind mount is /home/me/nexus-data. That home/me/nexus-data consists of the directory structure:

image

For some reason, when I point the migration tool at that path, I get this error.
image

The path was green till I entered my Nexus credentials and then suddenly went red, my creds in nexus are set to admin so its not a permission issue.

Pip and Conan migration issue

So migrating pip and conan repos we are hosting from Nexus 3 to Artifactory seems to get botched in a way that even after making the appropriate changes to index urls to locations of these packages.

When running a test build against the new index urls for these packages that were moved over I end up getting 404 errors.

HTTP error 404 while getting http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl#md5=22874c2949cbaac15a778176c2f0f546 (from http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*) Could not install requirement pip from http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl#md5=22874c2949cbaac15a778176c2f0f546 because of error 404 Client Error: Not Found for url: http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl Could not install requirement pip from http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl#md5=22874c2949cbaac15a778176c2f0f546 because of HTTP error 404 Client Error: Not Found for url: http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl for URL http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/packages/pip/19.2.3/pip-19.2.3-py2.py3-none-any.whl#md5=22874c2949cbaac15a778176c2f0f546 (from http://10.1.1.113:8081/artifactory/api/pypi/pypi-all/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*) "$PYTHON_MOD pip install -q --index-url $PIP_URL --trusted-host $PIP_IP --upgrade pip" command failed with exit code 1.

Nexus connection error

I'm trying to migrate a single repo (currently) using this tool, it accepts the data directory as valid but when I enter the URL and credentials it then marks the data directory as invalid.

I think the debug logs show a problem with a missing script on Nexus (but this might be a red herring): -

2018-02-14 11:50:41,429 [MainThread] [INFO] (nex2art.core.Nexus3:221) - System ping completed, status: 200.
2018-02-14 11:50:41,429 [MainThread] [INFO] (nex2art.core.Nexus3:42) - Reading repository config from Nexus.
2018-02-14 11:50:41,430 [MainThread] [INFO] (nex2art.core.Nexus3:135) - Attempting to communicate with Nexus server.
2018-02-14 11:50:41,430 [MainThread] [INFO] (nex2art.core.Nexus3:151) - Deploying extraction plugin to Nexus.
2018-02-14 11:50:41,436 [MainThread] [INFO] (nex2art.core.Nexus3:241) - http://nexus.REDACTED.com/service/siesta/rest/v1/script responded with 204.
2018-02-14 11:50:41,436 [MainThread] [INFO] (nex2art.core.Nexus3:155) - Executing Nexus extraction.
2018-02-14 11:50:41,481 [MainThread] [ERROR] (nex2art.core.Nexus3:236) - Error connecting to Nexus:
{
"name" : "artifactorymigrator",
"result" : "javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method browse() on null object"
}
Traceback (most recent call last):
File "/root/nexus2artifactory-master/nex2art/core/Nexus3.py", line 232, in dorequest
else: resp = urllib2.urlopen(req)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
2018-02-14 11:50:41,482 [MainThread] [INFO] (nex2art.core.Nexus3:241) - http://nexus.REDACTED.com/service/siesta/rest/v1/script/artifactorymigrator/run responded with 400.
2018-02-14 11:50:41,482 [MainThread] [ERROR] (nex2art.core.Nexus3:244) - Unable to execute Nexus plugin: 400.
2018-02-14 11:50:41,482 [MainThread] [INFO] (nex2art.core.Nexus3:158) - Deleting extraction plugin from Nexus.

I've tried multiple Nexus accounts including 'admin', and multiple URLs to access the server (i.e. localhost:8081 and FQDN).

Is this fixable in the tool or do we potentially have an issue with our Nexus install? I'm happy to provide any further details required.

Thanks for any help

Unhandled exception in line 105 of Progress.py#render

I have a mirrored instance of Nexus with Nexus2Artifactory installed on it, running in a docker container. Inside of that container I started a session of GNU Screen, to have the migration running as a background task and independently from my network connection. That migration took about 20 hours, so I reattached to the screen session on the next day. I saw that the migration was executed successfully (apart from several errors) and I wanted to quit the tool by pressing "q". But then this exception occured:

2019-10-21 09:23:08,582 [MainThread] [ERROR] (root:30) - Error running Nexus migration tool:
Traceback (most recent call last):
  File "./NexusToArtifactory.py", line 27, in initInteractive
    win.show()
  File "/nexus2artifactory/nex2art/core/Menu.py", line 179, in show
    if self.runact(sel, sel['act']): return
  File "/nexus2artifactory/nex2art/core/Menu.py", line 203, in runact
    elif hasattr(act, '__call__'): cont = self.showCall(sel, act)
  File "/nexus2artifactory/nex2art/core/Menu.py", line 223, in showCall
    cont = act(sel)
  File "/nexus2artifactory/nex2art/menu/Main.py", line 64, in runmigration
    status, msg = Progress(self.scr).show(self.scr.state.todict())
  File "/nexus2artifactory/nex2art/core/Progress.py", line 39, in show
    self.render(result)
  File "/nexus2artifactory/nex2art/core/Progress.py", line 105, in render
    while chr(self.scr.getch(self.scr.win)) != 'q': pass
ValueError: chr() arg not in range(256)
2019-10-21 09:23:08,637 [MainThread] [INFO] (root:33) - Terminating Nexus migration tool.

Currently I cannot reproduce it, I am not really sure what exact key sequence of keys I pressed. It seems there is a try to cast the input to a character, but my terminal sent some sequens which wasn't a character. Maybe an alternative should be found for the function chr.

x: Run Migration Failed

I have Initialed Setup , and Verify Configuration sucessfully , but when run x (Run Migration) the log show as follow :

Traceback (most recent call last):
File "./NexusToArtifactory.py", line 70, in
else: initInteractive(setup)
File "./NexusToArtifactory.py", line 27, in initInteractive
win.show()
File "/root/nexus2artifactory/nex2art/core/Menu.py", line 179, in show
if self.runact(sel, sel['act']): return
File "/root/nexus2artifactory/nex2art/core/Menu.py", line 203, in runact
elif hasattr(act, 'call'): cont = self.showCall(sel, act)
File "/root/nexus2artifactory/nex2art/core/Menu.py", line 223, in showCall
cont = act(sel)
File "/root/nexus2artifactory/nex2art/menu/Main.py", line 64, in runmigration
status, msg = Progress(self.scr).show(self.scr.state.todict())
File "/root/nexus2artifactory/nex2art/core/Progress.py", line 30, in show
result = self.scr.artifactory.migrate(self, conf)
File "/root/nexus2artifactory/nex2art/core/Artifactory.py", line 63, in migrate
if counts['repo'] > 0: self.migraterepos(conn, conf)
File "/root/nexus2artifactory/nex2art/core/Artifactory.py", line 193, in migraterepos
repos[res['key']] = True
TypeError: string indices must be integers, not str

my license is EnterpriseX license 7.3.2 rev

Error on windows

Hi all

I'm not able to start the script on a windows machine:

$ ./NexusToArtifactory.py
Traceback (most recent call last):
File "./NexusToArtifactory.py", line 4, in
import unicurses
File "E:\apps\nexus2artifactory\unicurses.py", line 60, in
pdlib = ctypes.CDLL(pdcursesdll) # we're on winXX, use pdcurses instead of native ncurses
File "E:\apps\Python27\lib\ctypes_init_.py", line 362, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

regards angela

Filter by type

I'm using nexus2artifactory and a feacture that i was not apple to find is to filter all type hosted for to migrate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.