Skip to content

How to convert normal repo to mirror? #5486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tacotexmex opened this issue Dec 6, 2018 · 10 comments
Closed

How to convert normal repo to mirror? #5486

tacotexmex opened this issue Dec 6, 2018 · 10 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@tacotexmex
Copy link

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.

@techknowlogick techknowlogick added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Dec 7, 2018
@techknowlogick
Copy link
Member

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

@tacotexmex
Copy link
Author

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

@techknowlogick
Copy link
Member

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.

@tacotexmex
Copy link
Author

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

@tacotexmex
Copy link
Author

tacotexmex commented 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.

@techknowlogick
Copy link
Member

@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

@tacotexmex
Copy link
Author

tacotexmex commented 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?

@techknowlogick
Copy link
Member

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

@tacotexmex
Copy link
Author

tacotexmex commented 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 !

@mrsdizzie
Copy link
Member

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

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants