I have currently gitlab ce version 12.2, I have installed new version gitlab ce 15.10 on new server. I have more then 500 repositories on old server. What is the best way to migrate all repositories to the new server ?
Easiest way is install Gitlab-CE 12.2 on the new server. Make backup on old Gitlab server, copy it to new server, and then restore it - using the Gitlab Backup/Restore documentation to do that. You will also need /etc/gitlab/gitlab.rb from the old server and /etc/gitlab/gitlab-secrets.json as well. Backups can only be restored to the same version of Gitlab, so this is why the new server must be 12.2. Back up and restore GitLab | GitLab
Then upgrade the new server following the upgrade path from 12.2 through to the latest Gitlab version by following the Gitlab Upgrade documentation. Ensuring that after each upgrade on the upgrade path that you wait for the background migrations to finish before starting the next upgrade. Upgrading GitLab | GitLab
Yes it’s time-consuming, but this is the easiest way of doing it. I don’t know of any method to do it how you asked since you will be missing a lot of things, such as database. Repository data on it’s own isn’t enough to migrate it’s not a simple copy to new server and forget about it.
There are plenty of posts on here already about upgrading via the upgrade path. For example: Inherited 9.3.8 Server Need to Upgrade - #4 by iwalker explains in great detail.
I also believe backup+restore+upgrade is the easiest way (by far).
We have done split (for security reasons - they were later resolved in a better way leading to a subsequent merge back, which presented the same problems) of our GitLab server. If you do an export of a project on one server and then import it on the other you get some (all?) of the historic data pertaining to that project with (at least the commit history, and everything we cared about, there are features we don’t use, I have no idea if their data is preserved). But as this is a per project/repository operation and you said you had more than 500 (we only needed to move 20-50, and we could ask the rest of the department 20-30 people to help, by taking care of the projects they used) repositories, this will turn into a massive operation in your case.
In recent releases (i.e. not back to 12.2) there have been some mention in the release announcements of a feature that might help (in the future)
but the first implementation was only for the SaaS offering (i.e. not for self-hosted instances), and as it’s not going to be particularly useful for us (it might have been if it had come to self-hosted instances before the mentioned merge back), I haven’t looked at the documentation for it, so I can’t even guess what it could do for you. But I suspect that you would need the feature in both ends, so it’s not really relevant when your old server is on 12.2.
I repeat: backup+restore+upgrade is the easiest way (by far). And the post pointed to by @iwalker is probably the best I’ve seen (you don’t have to do the stuff for versions older than what you have of course).