Edit Migration Configuration [OPTIONAL]
Customize migrationConfig.yaml to adjust thread count, logging level, regex rules, and checksum calculation settings.
After you run the migrator tool with the config option, the migrator tool creates the migrationConfig.yaml file inside the folder, <working directory>/migration/nexus-migrator.
The following example shows a sample migrationConfig.yaml file.
config:
artifactory:
serverId: Arty
migrator:
threads: 2
workDir: /root/.jfrog
defaultPassword: xxxxxxxxxxxx
checksumCalc: false
logging: INFO
security:
convertExternalUsersGroupsToInternal: false
repoRegex:
- source: ^[0-9](.*) $
target: m-[REPO]
pypiPathRegex:
- source: "^(simple|packages)/"
target: "$1-jfrog/"
userRegex:
- source: ^[0-9](.*) $
target: m-[USER]
- source: \s
target: '-'
groupRegex:
- source: ^[0-9](.*) $
target: m-[GROUP]
- source: \s
target: '-'
ldapRegex:
- source: ^[0-9](.*) $
target: m-[LDAP]
- source: \s
target: '-'
permRegex:
- source: ^[0-9](.*) $
target: m-[PERM]
nexus:
majorVersion: 3
minorVersion: 32
url: http://xx.xx.xx.xxx:8081
username: admin
password: xxxxxx
dataDir: /opt/sonatype-work/nexus3/Note
The Nexus URL must reach Nexus directly to resolve the Nexus version. Point the URL to the Nexus application port, not a proxy port. A reverse proxy or redirect may cause the connection to fail.
Warning
Enabling checksum for artifact upload increases memory utilization. Verify that the Nexus machine has sufficient free resources before setting checksumCalc: true.
Thread Configuration
Update the threads value under migrator in the YAML file to set the number of threads for the migrator tool. By default, threads are set to half the number of cores in the machine. If the Nexus Repository Manager machine becomes sluggish, reduce this number and run the migrator tool again.
Regex Rules for Renaming
Update the target value under repoRegex to set the prefix added to repositories whose names start with non-alphabetic characters. Do not edit values in square brackets (such as [REPO]), because they are keywords used in Nexus. You can also add a new source and target to use a different name for a repository in Artifactory. For example, to rename repositories starting with "dfault" to "default", add a new source and target with the required values. To replace a substring in the name of a repository, user, group, LDAP settings name, LDAP group settings name, or permission, provide a regular expression in the source field and the replacement in the target field. By default, migrationConfig.yaml includes entries to replace space characters with a hyphen ( - ).
Logging Level
Update the logging value under migrator to set the logging level. The default level is INFO. Change the value to DEBUG for more detailed log messages.
External User Conversion
Set convertExternalUsersGroupsToInternal to true to convert all users and groups from an external source (for example, LDAP) to internal users and groups in Artifactory.
PyPI In-Repo Path Rewriting (pypiPathRegex)
pypiPathRegex)Purpose: Avoid Artifactory's reserved PyPI root paths (simple/, packages/) by rewriting source paths during deploy.
When it applies: Only to repositories whose Nexus format is pypi. Other repository formats are unaffected.
Default behavior (empty list): When pypiPathRegex is empty (the default), the migrator:
- Skips directory-style entries (paths ending in
/, for examplesimple/), because Artifactory regenerates the PyPI simple index automatically from uploaded wheel metadata. - Uploads real artifacts (wheels, sdists) to their original Nexus path. If that path collides with an Artifactory reserved root, Artifactory may reject the upload.
With user-provided rules: Each rule specifies a source (regex) and a target (replacement string). Rules are applied sequentially. If a rewrite occurs, the migrator first runs a HEAD check on the original path. If the artifact already exists there from a prior run, the new upload is skipped (idempotency). Otherwise the artifact is deployed under the rewritten path.
The following example rewrites paths under simple/ and packages/ by appending -jfrog to the root folder:
config:
migrator:
pypiPathRegex:
- source: "^(simple|packages)/"
target: "$1-jfrog/"With this rule:
simple/<pkg>/<file>.whl→simple-jfrog/<pkg>/<file>.whlpackages/<pkg>/<version>/<file>.whl→packages-jfrog/<pkg>/<version>/<file>.whl
The migrator auto-emits pypiPathRegex: [] when you run setConfig for a new migrationConfig.yaml, so you can discover this option without reading the release notes.
