# Mass repository migration

**URL:** <https://forum.gitea.com/t/mass-repository-migration/114>\
**Category:** Install/Maintain/Configure\
**Created:** [November 15, 2017, 10:55am UTC](https://forum.gitea.com/t/mass-repository-migration/114 "2017-11-15T10:55:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomposmiko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tomposmiko/32/81_2.png) [@tomposmiko](https://forum.gitea.com/u/tomposmiko)\
**Post date:** [November 15, 2017, 10:55am UTC](https://forum.gitea.com/t/mass-repository-migration/114/1 "2017-11-15T10:55:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomposmiko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tomposmiko/32/81_2.png) [@tomposmiko](https://forum.gitea.com/u/tomposmiko)\
**Post date:** [November 27, 2017, 9:11am UTC](https://forum.gitea.com/t/mass-repository-migration/114/2 "2017-11-27T09:11:38Z")

</div>

Does anybody have any idea?

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [November 28, 2017, 9:25pm UTC](https://forum.gitea.com/t/mass-repository-migration/114/3 "2017-11-28T21:25:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomposmiko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tomposmiko/32/81_2.png) [@tomposmiko](https://forum.gitea.com/u/tomposmiko)\
**Post date:** [November 28, 2017, 9:45pm UTC](https://forum.gitea.com/t/mass-repository-migration/114/4 "2017-11-28T21:45:42Z")

</div>

It would be great, thanks!

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [November 28, 2017, 10:08pm UTC](https://forum.gitea.com/t/mass-repository-migration/114/5 "2017-11-28T22:08:14Z")

</div>

EDIT: A better version of migration can be found here: [https://git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator](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](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.
