Migrating from Other Forges
forgejo-batch-migrate is a small CLI that bulk-migrates repositories from GitHub, GitLab, Gitea, another Forgejo, or any plain Git URL into a Forgejo instance such as CodeFloe.
It wraps Forgejo’s migration API and adds batching, rate limiting, and a dry-run mode so you can move a whole organization in one command instead of clicking through the web UI repo by repo.
This page covers the essentials for migrating to CodeFloe. See the project README for the full flag and config reference.
Install
Section titled “Install”Grab a pre-built binary from the releases page. Binaries are published for Linux, macOS, and Windows on both amd64 and arm64, so no toolchain is required:
Adjust the filename for your platform, and check the releases page for the latest version tag.
If you already have a Go toolchain, go install codefloe.com/codefloe/forgejo-batch-migrate/cmd@latest also works.
Tokens
Section titled “Tokens”You need two access tokens, supplied via environment variables:
FORGEJO_TARGET_TOKEN— a CodeFloe token, created under Settings → Applications → Access Tokens. This is mandatory for any real migration.SOURCE_TOKEN— a token for the source forge. It is optional for public repositories but strongly recommended, since unauthenticated source APIs are rate-limited aggressively.
Prefer environment variables (or --source-token-file / --target-token-file) over the literal --source-token / --target-token flags, which are visible in the process list.
Migrate
Section titled “Migrate”Point --source-type at your origin forge, select what to move (a whole org or individual repos), and target CodeFloe.
From GitHub
Section titled “From GitHub”Migrating a whole GitHub organization into a new CodeFloe org:
From Codeberg
Section titled “From Codeberg”Codeberg runs Forgejo, so use --source-type forgejo with --source-url https://codeberg.org.
Pick individual repositories with repeated --source-repo flags instead of --source-org:
Preview first
Section titled “Preview first”Always add --dry-run for a first pass.
It reports exactly what would be created without writing anything to CodeFloe:
What gets migrated
Section titled “What gets migrated”By default the tool brings across issues, pull requests, labels, milestones, releases, and the wiki. A few useful toggles:
--lfs— include Git LFS objects (off by default).--private— force all destination repos private.--issues=false,--pull-requests=false,--wiki=false— migrate code only, skipping metadata.--mirror --mirror-interval 24h0m0s— set up the destination as a pull mirror that keeps syncing from the source, rather than a one-time copy.--skip-existing(on by default) — skip repos that already exist on the target, so re-running a batch is safe.
If something goes wrong or you hit an edge case, please open an issue in the forgejo-batch-migrate repository.