How to convert normal repo to mirror? #2632

Closed
opened 2025-11-02 04:42:52 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @tacotexmex on GitHub (Dec 6, 2018).

I know mirrors may be convertes to normal repos but what about the opposite? I’d like to keep the issue repos while ditching the code itself and import it from another repo.

Originally created by @tacotexmex on GitHub (Dec 6, 2018). I know mirrors may be convertes to normal repos but what about the opposite? I’d like to keep the issue repos while ditching the code itself and import it from another repo.
GiteaMirror added the type/proposal label 2025-11-02 04:42:52 -06:00
Author
Owner

@techknowlogick commented on GitHub (Dec 7, 2018):

This does not currently exist. I've labeled this issue as proposal in case someone creates PR for it.

@techknowlogick commented on GitHub (Dec 7, 2018): This does not currently exist. I've labeled this issue as proposal in case someone creates PR for it.
Author
Owner

@tacotexmex commented on GitHub (Dec 7, 2018):

I see. Is there a workaround? Perhaps one that involves moving issues over to another repo instead?

@tacotexmex commented on GitHub (Dec 7, 2018): I see. Is there a workaround? Perhaps one that involves moving issues over to another repo instead?
Author
Owner

@techknowlogick commented on GitHub (Dec 8, 2018):

You might be able to change the status in the DB directly. If I remember I think there is a is_mirror column in the repository table. You may need to restart the binary if you try this. Of course the standard cautions are in place, of make sure you back up your data before doing this change.

@techknowlogick commented on GitHub (Dec 8, 2018): You might be able to change the status in the DB directly. If I remember I think there is a `is_mirror` column in the `repository` table. You may need to restart the binary if you try this. Of course the standard cautions are in place, of make sure you back up your data before doing this change.
Author
Owner

@tacotexmex commented on GitHub (Dec 8, 2018):

Cool, even I should be able to pull that off. Thank you!

@tacotexmex commented on GitHub (Dec 8, 2018): Cool, even I should be able to pull that off. Thank you!
Author
Owner

@tacotexmex commented on GitHub (Dec 17, 2018):

Doing UPDATE repository SET is_mirror='1' WHERE id=10 alone throws an app error 500 on the page of that repo afterwards, so more edits seem needed.

Unlucky for me I'm not able to use anything else than the command line.

@tacotexmex commented on GitHub (Dec 17, 2018): Doing `UPDATE repository SET is_mirror='1' WHERE id=10` alone throws an app error 500 on the page of that repo afterwards, so more edits seem needed. Unlucky for me I'm not able to use anything else than the command line.
Author
Owner

@techknowlogick commented on GitHub (Dec 17, 2018):

@tacotexmex mirrors table may need an insert too (I feel like I'm always in a constant state of jetlag, and so I apologize for missing that in my original assessment)
screen shot 2018-12-17 at 2 52 35 pm

@techknowlogick commented on GitHub (Dec 17, 2018): @tacotexmex mirrors table may need an insert too (I feel like I'm always in a constant state of jetlag, and so I apologize for missing that in my original assessment) ![screen shot 2018-12-17 at 2 52 35 pm](https://user-images.githubusercontent.com/164197/50111721-6beb7680-020b-11e9-8a74-4bbf25720f24.png)
Author
Owner

@tacotexmex commented on GitHub (Dec 17, 2018):

Inserting a new line in mirror table did reveal the mirror section in the repo settings. It tells me it has synchronized, however the code doesn't show.

Is it simply because there's already a file populating the repo from before it was a mirror? If so, how do I safely remove the relevant old repo information and files to make way for the new one?

@tacotexmex commented on GitHub (Dec 17, 2018): Inserting a new line in `mirror` table did reveal the mirror section in the repo settings. It tells me it has synchronized, however the code doesn't show. Is it simply because there's already a file populating the repo from before it was a mirror? If so, how do I safely remove the relevant old repo information and files to make way for the new one?
Author
Owner

@techknowlogick commented on GitHub (Dec 18, 2018):

Perhaps you could try going into where the repositories are stored on disk and modifying the config

An example config from my gitea instance of a mirror'd repo:

[core]
	repositoryformatversion = 0
	filemode = true
	bare = true
[remote "origin"]
	url = https://github.com/go-gitea/gitea.git
	fetch = +refs/*:refs/*
	mirror = true
@techknowlogick commented on GitHub (Dec 18, 2018): Perhaps you could try going into where the repositories are stored on disk and modifying the config An example config from my gitea instance of a mirror'd repo: ``` [core] repositoryformatversion = 0 filemode = true bare = true [remote "origin"] url = https://github.com/go-gitea/gitea.git fetch = +refs/*:refs/* mirror = true ```
Author
Owner

@tacotexmex commented on GitHub (Dec 19, 2018):

~~ I added it but it wasn't enough. Again, there's a readme file in the repo already. May that perhaps prohibit the mirroring and if so, how can I clean up the repo without causing damage?

The important thing here is preserving the issues. ~~

Apparently that was enough. Thanks a bunch @techknowlogick !

@tacotexmex commented on GitHub (Dec 19, 2018): ~~ I added it but it wasn't enough. Again, there's a readme file in the repo already. May that perhaps prohibit the mirroring and if so, how can I clean up the repo without causing damage? The important thing here is preserving the issues. ~~ Apparently that was enough. Thanks a bunch @techknowlogick !
Author
Owner

@mrsdizzie commented on GitHub (Sep 8, 2020):

Closing as this is a pretty niche case and I don't think the proper way to solve this particular issue. #453 tracks copying issues from one repo to another which I think would be the right feature for somebody to add to solve a problem like this

@mrsdizzie commented on GitHub (Sep 8, 2020): Closing as this is a pretty niche case and I don't think the proper way to solve this particular issue. #453 tracks copying issues from one repo to another which I think would be the right feature for somebody to add to solve a problem like this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2632