Additional step needed for migrating if you have old repos with non `main` default branches
On https://gitlab.com/mikestreety/mikestreety/-/blob/main/app/content/blog/2021-03-08-migrating-gitlab-from-one-server-to-another.md there is another step needed because of this issue: gitlab-org/gitlab#343905 (closed).
Solution as posted gitlab-org/gitlab#343905 (comment 770735311) is to run gitlab-rails c
and then in the console:
Project.all.each {|p| p.change_head(p.default_branch) }
Which will write the correct ref to the HEAD file in the bare repositories.
This step isn't needed if all your repositories use main
as their default branch.