Skip to content
Mementropy
Lab NotesHomelab notebookField note

Moving 14 repositories from Forgejo to Gitea

Took 11 seconds with issues and PRs. Host allowlists and repos with issues turned off got in the way.

By Ryan Hammang

Today I moved my 14 active repositories from the old Forgejo server to the new Gitea on K3s.

Three things got in the way.

Repos with issues turned off. The pre-migration audit asked Forgejo for each repo’s issues. Three repos returned 404, because they have issues turned off. The script now handles the 404 and passes each repo’s issues, pull-request and wiki settings into Gitea’s migrate API.

DNS inside the pod. The Gitea pod couldn’t resolve the old server’s Tailscale name. K3s CoreDNS uses the host’s normal resolver, not Tailscale’s MagicDNS. I added a hostAliases entry for the old server.

The host allowlist. Even with local networks allowed, the migrate call returned:

HTTP 422: You can not import from disallowed hosts.

I added the Tailscale domain to both [security] ALLOWED_HOST_LIST and [migrations] ALLOWED_DOMAINS.

Then it ran. All 14 repos moved in 11.4 seconds, with every branch (47), tag (7), LFS object, and issue and PR (17). The HEAD commits matched on every repo. A dump and test restore afterwards showed 15 repos and 17 issues and PRs.

Next I need the GitHub mirrors running from Gitea instead of Forgejo.

Recipes written later from this work: