API: How to convert a pull mirror repo into a normal repo using the API


Version: Gitea version 1.21.0

I have effectively replicated an older Gitea instance that was hosted in a docker container into a VM hosted in our data center and have 170 “pull mirrored” repos that need to be converted into “regular” repos. I know that a repo can be converted to “regular” one using the GUI (feature at the bottom of the repo settings page), but this is far too many repos to be converted manually. Also, to create them again as non-mirrored repos would also take considerable time and break our standby methodology.

Our overarching goal is to achieve some degree of high availability, at least have a second instance of Gitea to act as a temporary replacement. This can be achieved via mirroring each repo and its associated metadata (orgs, teams, hooks, releases, etc.), but if we can’t convert a mirrored repo into a regular one, then what we seem to be left with is a read-only replica of Gitea.

What is the API call, SQL call, or back door call to covert the mirrored repo into regular one?

Things I’ve looked at: