Migrating repositories from Forgejo to Gitea
Use Gitea's migrate API, with allowlists and per-repo unit settings.
What it’s for
Section titled “What it’s for”Moving repositories with issues, PRs, LFS and wiki from Forgejo to Gitea.
What you need
Section titled “What you need”- API tokens on both servers
- Gitea able to resolve and reach the Forgejo host
- Allow the source host in Gitea’s
app.ini:
[security]ALLOWED_HOST_LIST = <forgejo-domain>[migrations]ALLOWED_DOMAINS = <forgejo-domain>ALLOW_LOCALNETWORKS = true-
List source repos and read each one’s
has_issues,has_pull_requestsandhas_wiki. Treat a 404 on/issuesas “issues turned off”. -
For each repo, call
POST /api/v1/repos/migratewithclone_addr,repo_name,mirror: false,lfs: true, the auth token, andissues,pull_requestsandwikiset from step 2.
Check it worked
Section titled “Check it worked”- Branch and tag counts match per repo.
- HEAD commit SHAs match per repo.
- Issue and PR counts match.
Traps seen
Section titled “Traps seen”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_DOMAINSalso limits push mirrors later. Addgithub.comif you mirror there.
Where this came from
Section titled “Where this came from”- Moving 14 repositories from Forgejo to Gitea (2026-10-18)