Migrate from Artifactory or Nexus

  • Tier: Premium, Ultimate
  • Offering: GitLab.com
  • Status: Beta

You do not have to move every artifact at once. Instead, point Artifact Central at the registry you use today, such as JFrog Artifactory or Sonatype Nexus Repository. Your builds pull through Artifact Central, and it caches each artifact they use. New versions go to Artifact Central directly.

Your existing registry stays the system of record for versions published before you move publishing to Artifact Central. During the beta, keep your existing registry as the system of record. Do step 4 after the beta, or if your team accepts the beta risk.

Artifact Central has no bulk import. Only the artifacts your clients pull come across.

Gradual migration workflow

Move your builds to Artifact Central in stages. If a build breaks, point it back at your existing registry. Rollback works for versions that exist in your existing registry. Versions published after step 4 live only in the hosted repository, so a build that needs one keeps pointing at Artifact Central.

To migrate gradually:

  1. Create a remote repository for each repository and format in your existing registry.
  2. Put the remote repositories behind a virtual repository, so builds use one URL.
  3. Point package clients and CI/CD jobs at the virtual repository. Each artifact a build pulls is cached in Artifact Central.
  4. Add a hosted repository to the virtual repository, and publish new versions there.
  5. Publish every version your builds still need to the hosted repository, then turn off the old registry.

Prerequisites

  • The Artifact Admin role, to create repositories
  • The URL of each repository in your existing registry that you want to migrate
  • Read-only credentials for your existing registry:
    • Maven and container repositories: a username and password
    • npm repositories: an authentication token

Create a remote repository for each upstream

A remote repository proxies one upstream registry over HTTPS. Create one for each repository and format in your existing registry.

  1. Create a remote repository with the same format as the upstream. For more information, see create a repository.
  2. Set the upstream URL to the repository URL your clients use today.
  3. Set the upstream credentials. For more information, see upstream credentials.
  4. Test the upstream connection.

Do not put credentials in the upstream URL. Anyone who can view the remote repository can see the URL.

Your existing registry might let you overwrite an artifact. A remote repository checks a cached content file against the upstream after cache_validity_hours passes, which is 24 hours by default. For more information, see caching and freshness.

Put the remote repositories behind a virtual repository

A virtual repository serves several repositories through one URL. It checks its upstreams in order and returns the first match. Version lists are different. For npm package metadata and Maven maven-metadata.xml, it combines the versions from every upstream.

  1. Create a virtual repository with the same format.
  2. Add the remote repositories as upstreams. For more information, see set the upstreams of a virtual repository.

To also serve public Maven packages, add a remote repository for Maven Central to the same virtual repository. List it as the last upstream, so your other upstreams come first for a package with the same name. For more information, see use a remote or virtual repository in place of Maven Central.

Add a remote repository for https://registry.npmjs.org to the same virtual repository only if your organization owns the scope of every private package on npmjs.com. The virtual repository combines the versions from every upstream. If a private package has no scope, or your organization doesn’t own its scope, anyone can publish a higher version with the same name. Your builds then install that version.

Point your builds at Artifact Central

Change the registry URL in your package client configuration and CI/CD jobs to the virtual repository URL. For more information, see:

Each time a build pulls an artifact that is not cached yet, Artifact Central fetches it from your existing registry and caches it.

Publish new versions to a hosted repository

You cannot publish to a remote or virtual repository. To publish new versions in Artifact Central:

  1. Create a hosted repository with the same format.
  2. Add it to the virtual repository’s upstreams, ahead of the remote repositories.
  3. Change your publish jobs to publish to the hosted repository.

Builds then pull new versions from the hosted repository, and older versions through the remote repositories.

Retire your existing registry

Keep your existing registry running while builds need any version that exists only there. To retire it sooner, publish those versions to the hosted repository first.

While builds depend on your existing registry, an outage in your registry can break them. Artifact Central serves cached artifacts after it marks the upstream unhealthy, but artifacts that are not cached fail. Artifact Central checks each upstream every few minutes, and marks it unhealthy after three failed checks in a row.

ArtifactBefore the upstream is marked unhealthyAfter the upstream is marked unhealthy
Not cachedFails at once503 or 404
Cached and freshServed from the cacheServed from the cache
Cached and stale404 if another upstream reports it missing, such as the hosted repository or a remote for Maven Central or npmjs.com. Otherwise, served from the cache.Served from the cache

During a migration, most artifacts are not cached yet, so most builds fail as soon as the outage starts.

Known issues

  • Artifact Central has no bulk import. Only artifacts that clients pull through a remote repository come across.
  • You can migrate Maven, npm, Docker, and OCI artifacts.
  • You cannot convert a remote repository to a hosted repository. This change is proposed in issue 630577.