Moving house: GitHub ➡️ Codeberg

I decided to move some of my repositories from GitHub to Codeberg and my personal server. At first, I focused on ones where I feel there’s still a chance I’ll continue working on them.

Codeberg’s terms of use only allow FOSS repositories (with a few minor exceptions). Luckily, that perfectly matches my intentions: to host public, open source projects on Codeberg, and private, closed source or license-pending ones on my own Forgejo instance or git.tsuki.games.

Migrating repositories over is much easier than I initially anticipated. It’s basically a one-click operation to import a GitHub repo into Forgejo, with all the GitHub metadata (issues, PRs, releases, wiki, etc.), and Codeberg of course also runs Forgejo.

All I had to do was generate a GitHub personal access token, then pass that over to the target instance along with the HTTPS clone URL of the source repo. It’s a good idea to save the token somewhere for reuse, as Forgejo asks for it each time you start a repo migration.

The smallest projects were copied in 1-2 seconds, the largest one - Pillars of Anguish - took under half a minute. I don’t normally trust such one-click processes to do things correctly, so I erred on the manual side when I was moving Re:Placement to my private forge. But now I see that using the automation would’ve saved me a lot of hassle in copying all the issues (which is basically our todo list). I would’ve only had to reassign team members to issues, and issues to kanban boards, which I did anyway.

My active projects will live primarily on Codeberg, my forge, and git.tsuki.games from now on. However, I still want people to be able to file issues and submit PRs on GitHub, to keep friction low - particularly for the Godot community, which for the time being is centred around GitHub. And there’s actually an easy solution.

I paste the SSH URL of the GitHub mirror into the Forgejo repo settings, tell it to use SSH authentication, sync on push, and disable periodic sync. Then I copy the SSH public key into my GitHub account, and it’s good to go. If pull requests appear on GitHub, I can merge them locally, push to Codeberg, and have them synced back to GitHub (tho I may need to close the PRs manually - oh well).

2 Likes

For those interested: forgejo also has a pretty convenient mirroring functionality which allows you to replicate your repo on a bunch of providers like github, gitlab, bitbucket, other forgejo instances, etc. This means you can develop on a local instance and have any changes automatically uploaded to somewhere else for viewing/backup.

Do you mean the one I mention in the last portion of my post, or a different one? (Sorry if the post is a bit rambly :sweat_smile:)

OH, you’re right, silly me :woozy_face: My excuse is that my eyes started just skimming the post once you got into the technical details, since i also used those processes before :face_with_hand_over_mouth:

1 Like

Migrating is generally pretty straightforward, but I did run into a few problems migrating from a self-hosted gitea because it was hosted behind nginx and there were some nginx configuration issues that prevented the migration from completing successfully that I ran info, like connection time limits.

1 Like