Skip to content
7 min read

Migrating to Forgejo

Moving a team to Forgejo is mostly a planning problem. The importer does the copying; the work is deciding what has to come across, in what order, and how you will know it arrived. This guide covers that plan: taking stock, choosing between a one-time import and a mirror, handling CI, and checking the move before you switch people over. The step-by-step walkthroughs are linked where they apply.

Note

Fjord sells managed Forgejo hosting, so we have a stake in how this reads. Claims about Forgejo cite Forgejo’s documentation and one Codeberg page, opened on 2026-11-01. Claims about Fjord cite Fjord’s own pages. Where a page does not say something, this guide says so instead of filling the gap.

Take stock of what you are moving

A repository is rarely just commits. List what has to come across before choosing a method, because the method decides what you keep.

WhatDoes it come with an import?
Git history, branches, tagsYes, always.
Issues, labels, milestones, releases, wikiOnly through a migrator, from a source it supports.
Pull requests and their discussionFjord’s pages say Forgejo’s GitHub importer brings them. The Codeberg page below does not mention pull requests, so check on a test repository.
CI workflow filesThey live in the repository, so they travel with it. They may not run unchanged (see below).
CI secrets and variablesNo. Recreate them on the new forge.
Webhooks, bots, integrationsNo. Recreate them against the new address.
Who wrote whatNot described. See “What these pages do not say”.

Where this comes from. Codeberg’s

Migrating Repositories page, which describes Forgejo's migration form, lists GitHub, GitLab, Gitea and Forgejo, Gogs, OneDev, GitBucket and Codebase as sources whose metadata can be migrated, "like issues, labels, wiki, releases, milestones, etc." For any other host there is a plain Git option, which "will not migrate mentioned metadata." An access token is required "to migrate metadata or non-public repositories", and the page advises deleting the token afterwards. Fjord's [migration page](/platform/migrating) and [GitHub walkthrough](/migrate-from-github) describe the same flow for a Fjord instance, and say that a `git push --mirror` moves Git refs and nothing else, so use the importer when the conversation history matters.

Give the token the least read scope that works, only to the repositories you are moving. Revoke it when a one-time import finishes. A private pull mirror is the exception: it needs the token for every scheduled sync and for the final one, so keep the scoped token until the final sync and the conversion to a normal repository, then revoke it.

One-time import or mirror

  • One-time import. The simplest path when the source can stop taking writes while you move it: import, verify, update remotes, then archive or lock the source.
  • Pull mirror. Forgejo keeps pulling from the source on a schedule, which gives a window where both sides are live while the team moves over. Forgejo’s repository mirror page says a pull mirror is created from **New Migration** by ticking "This repository will be a mirror", that it can only be set up for a repository that does not exist yet on your instance, and that syncing is periodic, with a **Synchronize Now** button to force one. It states no sync interval.

For the cutover from a mirror, Fjord’s migration runbook describes the order: freeze writes on the source, let the mirror pull one last time, check that the refs match, convert the mirror to a normal repository, and only then have everyone push to the new home.

One direction to avoid by accident: the same mirror page warns that a push mirror force-pushes and “will overwrite any changes in the remote repository”. If you set up a push mirror back to the old host to keep it in step, make sure it points the way you intend.

Move in waves

Moving fifty repositories at once makes failures hard to attribute. Move a small wave, verify it, then continue. The Codeberg page says a migration “might take a while, depending on how large the repo is”, and that a failed migration can leave a repository that returns a 500 error, which you delete from its settings and retry. A long-running import is not necessarily a hang, and a failed one is not a reason to stop the wave. For scripting a batch with the fj CLI, see the GitHub walkthrough.

CI is the part that needs porting

If your workflows are GitHub Actions workflows, expect porting, not a rename. Forgejo’s own comparison page says “Forgejo Actions is designed to be familiar to users of GitHub Actions, but it is not designed to be compatible”, and “Workflows should work with some minimal changes.” It names these differences:

  • The default environment is very different: most runners use a Debian image with little more than Node.js, where GitHub uses a larger Ubuntu image.
  • Some keys in the github context are missing.
  • Some job subkeys are ignored, such as permissions and continue-on-error.
  • OIDC token generation uses the enable-openid-connect key in the workflow file instead of permissions: id-token: write.

The lower-risk order is to separate the two moves, and to keep development where checks run. A pipeline left on GitHub or GitLab only sees commits pushed there; it does not run on pushes or pull requests made on Forgejo. So import the repository to check it, keep new work landing on the source (for example behind a pull mirror), port workflows one at a time starting with the ones that gate merging, and run each on Forgejo before you trust it. Move development when those are proven, not on the day the repository lands. If you have to move earlier, build and test a bridge that runs your pipelines on the new commits and reports status back first. A pull mirror syncs Git data only. Any issue, pull request, comment or release that is created, edited or closed on the source after the metadata import is not copied. Either freeze those changes before the import, or reconcile every change made since it after the final freeze. A freeze at cutover alone leaves the intervening weeks of discussion behind. Fjord’s GitHub walkthrough covers this in more detail, and Forgejo CI runners covers where the jobs run.

Verify before you decommission the source

Do not lock the old repository until you have checked the new one:

  • Refs match, at the final revision. The final sync finished without error, and the branch and tag names and the commit ids they point to match the frozen source. Counts alone can match while the newest commits are missing. Do this before you convert a mirror, revoke the token or lock the source.
  • Metadata is there. Spot-check issues, pull requests and releases with their history, not just the default branch.
  • CI is green. Run a workflow on the new forge, so missing secrets show up now.
  • A fresh clone works. Clone into a clean directory and build, as a new teammate would.

Then repoint what talked to the old host: local clones’ remotes, webhooks and bots (recreate them and disable the old ones), and anything that published from the old repository.

What these pages do not say

The Codeberg page mentions neither how authors and users are mapped nor rate limits, and Forgejo’s contributor page on migration, which describes how the code is organised, lists neither the supported sources nor what is migrated. So before a large move, import one representative repository and look at how authorship, mentions and attachments appear. Treat that as part of the plan, not as an afterthought.

Choosing the destination

The destination is the same Forgejo either way, so this is the choice from Deploying Forgejo: a server you operate, or a managed instance. On Fjord, Migrate to Fjord covers the import, and its tip says support can help plan a larger move. Moving between a self-run Forgejo and a managed one later is another migration with the same plan.

Part of the Forgejo hosting guides. Related: Deploying Forgejo, Forgejo hosting costs, Forgejo CI runners, and Forgejo backup and disaster recovery. For the wider picture of what a provider takes over, see

Managed Forgejo hosting: what you hand over and what to ask.
Contributors
  • Stephen Way