Is it possible to "adopt" or take over existing mirrors, or a whole organization in gitea?
More specifically I have a home gitea instance: I commit personal projects there; some of my systems which can do config backups to git send those configs to their own repos; and I have a "mirror" user/organization that I use with Gitea's own mirror function and it watches ... many repos. I'd like it if I could let gitea-mirror take over managing the mirrors. I say "take over" because I'd prefer not to have to pull 7500 repos again (some of which no longer exist)
Is it possible to "adopt" or take over existing mirrors, or a whole organization in gitea?
More specifically I have a home gitea instance: I commit personal projects there; some of my systems which can do config backups to git send those configs to their own repos; and I have a "mirror" user/organization that I use with Gitea's own mirror function and it watches ... many repos. I'd like it if I could let `gitea-mirror` take over managing the mirrors. I say "take over" because I'd prefer not to have to pull 7500 repos again (some of which no longer exist)
<!-- github-sync-id:5650621769 -->
Thanks for the question. There is partial support for this already: Settings has a Reconcile option that can adopt existing Gitea pull mirrors into gitea-mirror without cloning them again. It has limits though. It only looks at owners that gitea-mirror mirrors into, it only adopts mirrors whose original URL points at a source you have connected, and mirrors whose upstream repo no longer exists won't map to anything. We also haven't tried it at anything close to 7500 repos.
If you want to try it, please be careful. Before anything else, take a full backup of your Gitea (gitea dump plus the database and repository storage) and make sure you can actually restore it. Better still, restore that backup onto a spare Gitea instance and point gitea-mirror at the copy first. Run Reconcile there as a dry run, look at what it would adopt, and only then decide whether to do it on your real instance. Since some of your upstream repos are gone, I'd expect a number of mirrors that can't be matched, and it's much safer to find that out on a copy.
We're holding off on building more around this for now, but if you test it on a copy, let us know how it goes and where it falls short for your layout.
@ckuethe
Thanks for the question. There is partial support for this already: Settings has a Reconcile option that can adopt existing Gitea pull mirrors into gitea-mirror without cloning them again. It has limits though. It only looks at owners that gitea-mirror mirrors into, it only adopts mirrors whose original URL points at a source you have connected, and mirrors whose upstream repo no longer exists won't map to anything. We also haven't tried it at anything close to 7500 repos.
If you want to try it, please be careful. Before anything else, take a full backup of your Gitea (`gitea dump` plus the database and repository storage) and make sure you can actually restore it. Better still, restore that backup onto a spare Gitea instance and point gitea-mirror at the copy first. Run Reconcile there as a dry run, look at what it would adopt, and only then decide whether to do it on your real instance. Since some of your upstream repos are gone, I'd expect a number of mirrors that can't be matched, and it's much safer to find that out on a copy.
We're holding off on building more around this for now, but if you test it on a copy, let us know how it goes and where it falls short for your layout.
@ckuethe
<!-- github-comment-id:6162277394 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Is it possible to "adopt" or take over existing mirrors, or a whole organization in gitea?
More specifically I have a home gitea instance: I commit personal projects there; some of my systems which can do config backups to git send those configs to their own repos; and I have a "mirror" user/organization that I use with Gitea's own mirror function and it watches ... many repos. I'd like it if I could let
gitea-mirrortake over managing the mirrors. I say "take over" because I'd prefer not to have to pull 7500 repos again (some of which no longer exist)Thanks for the question. There is partial support for this already: Settings has a Reconcile option that can adopt existing Gitea pull mirrors into gitea-mirror without cloning them again. It has limits though. It only looks at owners that gitea-mirror mirrors into, it only adopts mirrors whose original URL points at a source you have connected, and mirrors whose upstream repo no longer exists won't map to anything. We also haven't tried it at anything close to 7500 repos.
If you want to try it, please be careful. Before anything else, take a full backup of your Gitea (
gitea dumpplus the database and repository storage) and make sure you can actually restore it. Better still, restore that backup onto a spare Gitea instance and point gitea-mirror at the copy first. Run Reconcile there as a dry run, look at what it would adopt, and only then decide whether to do it on your real instance. Since some of your upstream repos are gone, I'd expect a number of mirrors that can't be matched, and it's much safer to find that out on a copy.We're holding off on building more around this for now, but if you test it on a copy, let us know how it goes and where it falls short for your layout.
@ckuethe