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).
Hi,
I have done according to way you suggested and completed restoration. I am going to start upgrade version from 14.6.1 to latest one but I have doubt about my Gitlab runners! Do I need to set up gitlab runners from old Gitlab which is currently used by team before upgrade or I can do after reaching latest gitlab version! Do you have any suggestion for Gitlab runners?
Thanks.
If your new server uses the same name/IP as the old server, then you shouldn’t have problems with the Gitlab Runners since it will connect to the new server via the DNS entry or same IP as the old server.
If you are running both servers at the same time, during the migration, then there will be problems. Or if you use different DNS entry or IP address, then it will not connect to it and you will need to re-register runners with the new server.
Hi,
I’m using different Ip therefore as you said I re-registered runners and I have upgraded to latest version.
Last question, taking backup restoration and upgrade took almost one month. There are a lot of change since took backup, is there any way to data transfer for last month or should i take backup again and do do restoration and upgrade while people doesn’t use gitlab?
Thanks for all your supports.
Backup/restore is the best method for that. Some people have used rsync
to move data from old to new server, there are posts on this forum about it - that could be one way forward if backup/restore takes too long for you. But even doing that, you will have to stop the old server to move data. Either way, Gitlab will be inaccessible.