Mass repository migration

hi All,

I have a bunch of git repositories on a server.
They are organized to a projects etc.

Is there way to migrate them to gitea?
I tried to copy them to the server and restart the service it didn’t notice there are new repositories to serve. That would be enough, so I could set permission later manually.

Does anybody have any idea?

I did something similar for a large number of git repos on github migrating to gitea. What I did was to call the api on github to get the HTTP clone path, and then using the gitea API I created a new migration with using the HTTP clone path.

If your other git host has HTTP clones then I could post my script as it might be useful for you.

It would be great, thanks!

EDIT: A better version of migration can be found here: https://git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator (not written by me) and it also migrates issues as well. Below text kept for archival sake but Jonas’ code is much better than mine so don’t use code below.

I’ve just posted a Gist of it with comments on github here: https://gist.github.com/techknowlogick/c2367e03baff9f16b3c5cc9d9a5d13ca

Note it is pretty untested, but I have been able to migrate > 300 repos from github to gitea with it so hopefully it’ll work for you too. In case your repos aren’t on github (as it sounds like they aren’t), then you can remove the github part of the script, and just put an array of your HTTP clone URLs and have the script loop over them instead.

Let me know if it doesn’t work, or if you need instructions on where to get tokens from for gitea, and I’d be glad to help.

2 Likes