Migrate projects with groups and group labels

Is there a way to migrate whole groups from one GitLab server to another, including subgroups, projects in the groups and group labels? When migrating just the projects and recreating the group tree, group labels are of course not transferred. Issues within the projects seem to keep their label strings and colors, thus (re)creating former group labels as project labels.

What’s the recommended way to restore the old group label structure and to ensure that issues keep their (group) labels and that projects don’t have duplicate labels after migration?