No, you do not need to copy the redis database, that is just what is in-memory when the server is running. You just restore, reconfigure and use the server.
Quick-step:
Install new server
Install same version of Gitlab on new server.
Take backup of old server
Copy /etc/gitlab/gitlab.rb and /etc/gitlab/gitlab-secrets.json from old server to new server
Copy backup to /var/opt/gitlab/backups on new server
Run initial reconfigure to get Gitlab running
Run restore
Run reconfigure once more
Start using Gitlab.
It’s explained in more detail in the documentation.
Many thanks for the Info.
I am running GitLab Version 15.3 on present server and have installed a later version (17.1) on new server. I guess there will be migration issues, so I have to downgrade to the same version of Gitlab on new server and do the upgrade after successful migration.
Yes, I was reading this before opening this query. I was just a bit uncertain with the many steps and setting changes needed before copying backup to target server. In case of a fallback (migration failure), I will need to undo all of these changes to get the old server back up and running.
I have to request a Gitlab service outage before I could perform this migration. Any idea how long this will take ?
That depends too much on your hardware (both the old and the new), the number of repos and several things about the actual repos, including but limited to:
their size
the number of merge requests
the number of issues
So we have no way of saying anything specific. But if you take regular backups the time they take will give an indication. Restore is typically slower (but it’s different hardware). The best way to get an indication is probably to perform a trial run, you don’t need to do anything else on the old server than take a backup, for a trial run a backup taken while GitLab is being used should be fine, so there should be nothing in the process that causes any risk to the existing setup, just don’t point DNS (or whatever is used to determine which is authoritative) to the new.
Present and new Server for Gitlab are both VM Guests having the same system resources.
For the trial, I can run
sudo gitlab-backup create
without performing the necessary steps mentioned in the documentation ?
I will take a VM snapshot before doing this.
What VM solution? And are the guests on the same piece of hardware (some VM solutions allow you to select that a guest should have access to a certain number of CPU’s, but “a CPU” is just whatever is in the computer it runs on, i.e. not the same between hardware).
As I said it depends on a lot of other factors in addition to the hardware, so I don’t think it helps much.
A VM snapshot is nice to have, but it’s what is mentioned in step 1 of the procedure you posted a screenshot of. And in most cases a running CI/CD job or a running background job will not cause the backup to be unusable (for test, it might be unusable for restoring to a working system in a consistent state, but that’s not really your goal when you just do a test). So yes, you can skip steps 2-7 if you don’t intend to use the system you restore the backup taken in step 8 to.
I was planning to downgrade Gitlab on the new server to Version 15.1 which is presently running but repo is just showing versions from 16.0 - 17.2 on new server running rocky Linux 9.4. How can I get version 15.1 and would this be compatible with rocky Linux 9.4 ?
.
I have no knowledge on how it works with rocky Linux, with Debian and derivatives (including Ubuntu), the recommendation is usually to install an older version and add an OS upgrade step among the GitLab upgrades.
Thanks!
Then I have to find out which Rocky Linux version/release Gitlab version 15.1 is available.
Presently our Gitlab is running on Centos 7.9 which is out of support and in our installation
we are mainly using rocky Linux now.
I have another option. Gitlab version 16 is available on Centos 7.9, so I will try to upgrade to
latest release on version 16 (16.9.1) from 15.1 and if successful, I will install the same on new Server running Rocky Linux 9.4 as this version/release is available there.
Best way is upgrade the CentOS 7.x one to the latest possible version of Gitlab and then at this point take a backup and restore it to the same Gitlab version on the new server.
Since older versions of Gitlab may not exist for Rocky 9.x.
I was able to upgrade from gitlab version 15.3.4-ce.0.el7 to latest 17.3.1-ce.0.el7 as the later Gitlab versions suddenly appeared on repos used by Centos 7.9. On the new server, running rocky Linux 9.4 Gitlab version 17.3.1-ce.0.el9 is installed.
Next step will be to create backup from 17.3.1-ce.0.el7 and restore this on 17.3.1-ce.0.el9
I was able to create a backup + and redis db dump on my present Gitlab server running Centos 7.9 and Gitlab 17.3.4 which tokk > 4 hours and almost requiring 1TB of additional disk space.
I noticed though that uid/gid of needed Gitlab users are different on present server and new server running Rocky Linux 9.4.