As part of our VM Maintenace we are migrating our Gitlab to another server with an upgraded OS version.
As recommended I am following the Backup and Restore method to perform this task. Although I have noticed it takes around 4 hours to finish just the restore part and hence the downtime.
Is there a quicker way to perform the same activity?
I’ve read this Topic where you can do this without using restore but is it recommended?
The topic you linked is doable, as some of the other people in the post have responded using such method. You do need to pay attention to permissions though, and I did do something similar recently whereby I had to repair a few permissions related with postgres or gitaly, but otherwise the majority of stuff worked. I have also restored a Gitlab installation using restic, of which I posted about here: 16.8.0 Backup/Restore Issues - how to repair? - #14 by iwalker this can potentially be a quicker method but again, permissions are some issues that need to be addressed.
The backup/restore procedures are probably the more easier and stress-free but as you found in your situation, when you have a lot of data to restore, it takes quite a lot of time.
In the first part, did you use rsync -avz to copy data? If yes, it should ideally preserve permissions right and we wouldn’t need to repair permissions of postgres or gitaly.
I used restic, but if you are using rsync, you need to use the function that doesn’t preserve UID/GID, since this will be different on the new server for each of the users created.
Normally just /var/opt/gitlab, /etc/gitlab and if you want the log files, then /var/log/gitlab. The /op/gitlab directory is where the binaries are from, and the main gitlab package should be installed already on the server so you don’t need that.