Skip to content

Import from Nexus per repository: copy a hosted repository's packages into Forge, resumable and verified #183

Closed

Description

@schmitch

Summary

Forge replaces Nexus (#37). Credential forwarding already moves the logins, and a proxy simply refills from its upstream. But the content of Nexus' hosted repositories has to be pushed again by hand: internal NuGet packages, images, Helm charts, raw files. This issue adds an importer, one repository at a time: point a Forge hosted repository at a Nexus hosted repository of the same format, and Forge copies its content.

Where things stand

  • There is no import.
  • The workaround is a script per format (dotnet nuget push per package, crane/skopeo per image, curl per chart). It loses:
    • the original publish dates. Retention's older_than_days then treats every imported version as brand new;
    • the last-download times. not_downloaded_for_days and keep_n_most_downloaded then start from zero;
    • who uploaded what.

Proposal

Starting an import

  • In the web UI (Repository → Import) and the admin API (POST /admin/repositories/{name}/imports), on a hosted Forge repository.
  • Source:
    • the Nexus base URL;
    • the Nexus repository name;
    • credentials, sealed with the secret encryption and deleted when the import finishes.
  • Preflight / dry run
    • Checks the Nexus version (/service/rest/v1/status) and that the source repository is hosted and of the same format (/service/rest/v1/repositories).
    • Counts components, assets and total size.
    • Lists the conflicts with versions Forge already has.

Copying

  • Walk GET /service/rest/v1/components?repository=<name>, page by page with continuationToken. The token is stored as the import's cursor, so an import resumes after a restart, a failure or a cancel.
  • Each asset is streamed from its downloadUrl into staging and verified against Nexus' checksums.
  • It is written through the normal hosted write path: format validation, package selectors, upload limit, CAS dedup and audit. The audit events carry the action import (Audit log in the database: searchable in the web UI and admin API, with retention and export #179).
  • Metadata is preserved where Nexus exposes it (recent Nexus 3 versions):
    • blobCreated / lastModified become the version's creation time;
    • lastDownloaded becomes its last download;
    • uploader is recorded in the audit details.
  • Conflicts
    • The same id/version with the same SHA-256 is skipped.
    • A different file under the same id/version is skipped and reported (the default), overwritten, or fails the import, as chosen.
  • Throughput: configurable concurrency (default 4), so Nexus is not overwhelmed.
  • Progress in the UI and API: components done/total, bytes, failures. Failed items can be retried on their own, and an import can be cancelled.
  • Re-running is an incremental sync that copies only what is new. Cutover is then an initial import, then a final delta just before DNS or client config switches to Forge.
  • One instance runs a given import at a time, with a lease in Postgres like the retention worker.

Per format

Out of scope

  • Proxy repositories: they refill from the upstream.
  • Groups: recreate them as configuration.
  • Nexus users, roles and privileges: credential forwarding covers sign-in.
  • Cleanup policies.

Open questions

  • Should the import also create the Forge repository from the Nexus repository's settings (name, format, redeploy policy, anonymous access)?
  • Artifactory as a second source later, with the same job model?

Acceptance criteria

  • e2e against a real Nexus 3 OSS container (sonatype/nexus3) seeded with NuGet packages, a multi-platform image with a cosign signature, and a Helm chart:
    • after the import, bytes and digests are identical and publish dates are preserved;
    • killing Forge mid-import and restarting resumes the import without duplicating anything;
    • a second run imports only items added to Nexus since.
  • Dry run reports counts, size and conflicts without writing anything.
  • Every conflict policy is covered by tests.
  • Imported versions are audited as imports.

Activity

  1. added
    enhancement
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 22, 2026
    b05ba2c
  3. added this to the Backlog milestone on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions