Converting user account into a group

How to convert a user account into a group?

We have a user account in gitlab.com that is effectively a group (the username is vgg - we’re a university research group) and we would like to convert it into a proper gitlab group (it probably should have never been a user in the first place).

I’ve found issue #16660 - Convert a user into a group which effectively says that it is not supported but at least one person says that they’ve managed to do it through a series of renaming, but it’s not clear how.

The path of:

  1. renaming the user to something else
  2. create a group with the original user name
  3. migrate the repos from the user to the new group

is doable for the amount of stuff we have but there’s also people saying that the original user name remains reserved which prevents creation of the group. Is that true? (I don’t want to test it and then be unable to revert it)

How can one convert a user account into a group (even if that involves a bunch of manual steps).

Here’s some more comments on different places:

  1. Current documentation for changing a repository path states that “The redirects are available as long as the original path is not claimed by another group, user, or project” which suggests that a previously used namespace (user/group) is not reserved.

  2. Back in early 2014 there was an issue whose discussion ended up being about whether the names should be reserved, and for how long, after a group/username change. At the time, user and group names would remain reserved forever (and route to the new location) while project names would not be reserved (and route to the new location until they were taken). The end of the issue, ended up with never reserving any name and route until the old names are taken.

Both suggest that renaming a user to free up the namespace for a group should work.

Hi,

within GitLab the username is also a namespace. The same applies to the path of a group. The namespace path is also unique within GitLab and if you rename a group or user GitLab stores redirects to the new path within so the users can still use the old path for a while.

From my point of understanding a redirect for old namespace paths exists as long as the old name is not taken. So if you change the username of vgg to vgg-old and create a group with path vgg immediately after that it should work.

You still have to move all the projects though. Depending on the amount of your projects you could take a look at Projects API > Transfer a project to a new namespace.

kind regards
Markus