Skip to content
Mementropy
RecipesHomelab recipesReference

Migrating repositories from Forgejo to Gitea

Use Gitea's migrate API, with allowlists and per-repo unit settings.

By Ryan Hammang

Moving repositories with issues, PRs, LFS and wiki from Forgejo to Gitea.

  • API tokens on both servers
  • Gitea able to resolve and reach the Forgejo host
  1. Allow the source host in Gitea’s app.ini:
[security]
ALLOWED_HOST_LIST = <forgejo-domain>
[migrations]
ALLOWED_DOMAINS = <forgejo-domain>
ALLOW_LOCALNETWORKS = true
  1. List source repos and read each one’s has_issues, has_pull_requests and has_wiki. Treat a 404 on /issues as “issues turned off”.

  2. For each repo, call POST /api/v1/repos/migrate with clone_addr, repo_name, mirror: false, lfs: true, the auth token, and issues, pull_requests and wiki set from step 2.

  • Branch and tag counts match per repo.
  • HEAD commit SHAs match per repo.
  • Issue and PR counts match.
  • HTTP 422: You can not import from disallowed hosts. until both allowlists include the source.
  • Pods don’t use Tailscale MagicDNS. Make the source name resolvable inside the cluster.
  • ALLOWED_DOMAINS also limits push mirrors later. Add github.com if you mirror there.