Swap fork and parent repositories but keep everything else as-is

I have a situation where a repo exists under one organization. I would like to “transfer” it to another organization, fork it back to original and keep all the PR info and issues, etc, in the original. Basically, I want to keep discussion as it was but convert the current parent to a fork.

An alternative approach may be like:

  1. org/repoA
  2. create fork newowner/repoA from org/repoA
  3. swap fork_id in the DB so that newowner/repoA is the parent of org/repoA

Is this viable alternative or is something liable to break here?

The parent repositories will add all the first level forks as it’s remote . Maybe you can copy the whole disk git repository to the new parent after all above steps so that the remotes will be kept in the parent repository.

OK, that’s good to know that this will work and there aren’t some terribly dragon hiding somewhere. Actually, I would like to keep the forks of the original repo as-is, just slip new parent in there. Then I guess adding a remote to the fork would do the trick.