Migrate Artifacts to Harness Artifact Registry
Learn how to migrate artifacts to Harness Artifact Registry using the Harness CLI.
This guide walks you through migrating artifacts to Harness Artifact Registry from other artifact registries and servers using the Harness CLI.
Before you begin
Make sure you have the following:
Harness CLI installed: Install the Harness CLI v1 (hc) and authenticate to your Harness account. Use the latest version.
Source registry access: Valid credentials (username and API token) for your source artifact registry (for example, Nexus).
Destination registries created: Create the target registries in Harness Artifact Registry before migration. Go to Artifact Registry best practices to review guidance on registry setup and configuration.
Permissions: Permissions to create and manage artifact registries in your Harness account. Go to RBAC in Harness to configure access control.
Step 1: Create target registries in Harness
Before migrating, create the destination registries in Harness Artifact Registry:
Navigate to Artifact Registry in your Harness project.
Select New Registry for each registry you want to migrate to.
Configure the registry type, name, and settings.
Note the registry identifier for use in the migration configuration.
Step 2: Prepare the migration configuration file
Supported artifact types
The migration tool supports the following artifact types:
DOCKER
Docker container images
HELM
OCI-compliant Helm charts
HELM_LEGACY
Non-OCI compliant Helm registries (automatically migrated to OCI-compliant format)
GENERIC
Generic artifacts and files
PYTHON
Python packages (PyPI)
MAVEN
Maven artifacts
NPM
NPM packages
NUGET
NuGet packages
RPM
RPM packages
GO
Go modules
CONDA
Conda packages
COMPOSER
Composer (PHP) packages
SWIFT
Swift packages
TERRAFORM
Terraform modules and providers
CRAN
R packages (CRAN format)
RUBY
RubyGems packages
ALPINE
Alpine Package Keeper (APK)
WOLFI
Wolfi Linux packages (APK)
Configuration structure
Create a YAML configuration file (for example, migration-config.yaml) that defines your migration settings.
The following example shows the configuration structure:
Configuration parameters
Source configuration
The source block configures the connection to your existing registry:
endpoint: Full HTTPS URL of your source registry.
type: Source registry type (for example,
NEXUS,JFROG).credentials.username: Username for source registry authentication.
credentials.password: API token for source registry (important: use API token, not user password). You can reference environment variables using
${VARIABLE_NAME}syntax (for example,${SOURCE_PASSWORD}).insecure: Set to
trueto skip SSL certificate verification (use with caution).
Destination configuration
The destination block points to Harness Artifact Registry:
endpoint: Always
https://pkg.harness.iofor Harness Artifact Registry.type: Always
HARfor Harness.credentials.username: Your Harness username.
credentials.password: Harness authentication token. You can reference environment variables using
${VARIABLE_NAME}syntax (for example,${HARNESS_TOKEN}).
Mappings
Each mapping defines how artifacts are migrated from source to destination:
artifactType: Type of artifact (see supported types table above).
sourceRegistry: Repository name or ID in your source registry.
destinationRegistry: Registry identifier in Harness (must be created beforehand).
sourcePackageHostname (optional): Override the source hostname for Docker and Helm artifacts.
Configuration best practices
Use environment variables for sensitive credentials:
Use API tokens, not passwords, for authentication.
Always use HTTPS (
https://) for both source and destination endpoints.Start with low concurrency (1-2) for initial testing, then increase for production migrations.
Test with a small registry before migrating large repositories.
Step 3: Run the migration
Execute the migration using the Harness CLI:
Available flags
-c, --config
Path to configuration file
config.yaml
--concurrency
Number of concurrent operations (overrides config)
1
--dry-run
Run migration in dry-run mode (no uploads, generates file list and directory structure)
false
--overwrite
Allow overwriting existing artifacts
false
--pkg-url
Base URL for the package API (overrides config)
-
-v, --verbose
Enable verbose logging
false
Example commands
Basic migration:
Migration with custom concurrency:
Migration with overwrite enabled:
Migration with verbose logging:
Dry-run migration (preview without uploading):
This generates a file list and directory structure of what would be migrated without performing any uploads. Use this to verify your configuration before running the actual migration.
Troubleshooting
For additional help, run hc registry migrate --help or contact Harness Support.
Next steps
After successful migration:
Update your CI/CD pipelines to use Harness Artifact Registry. Go to Artifact Registry and CD to configure pipeline integrations.
Go to Configure registries to set up upstream proxies if needed.
Go to Webhooks to configure automation for your registries.
Last updated
Was this helpful?