Gitea: How to convert normal repo to mirror?

Created on 6 Dec 2018  路  10Comments  路  Source: go-gitea/gitea

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

kinproposal

Most helpful comment

@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

All 10 comments

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

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

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.

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

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 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

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?

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

~~ 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 !

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BRMateus2 picture BRMateus2  路  3Comments

BNolet picture BNolet  路  3Comments

kifirkin picture kifirkin  路  3Comments

Fastidious picture Fastidious  路  3Comments

kolargol picture kolargol  路  3Comments