I currently have 16.? installed on Mint20. My git-data repository has been moved to /home.
I installed exactly the same version on Mint21.
Mint20 and Mint21 are installed on different partitions on the same machine. I booted into Mint21 and I I copied my gitlab environment to mint21:
sudo rsync -av /mint20/home/myuser/.ssh /home/myuser
sudo rsync -av /mint20/etc/gitlab /etc
sudo rsync -av /mint20/var/opt/gitlab /var/opt
sudo rsync -av /mint20/home/git-data /home
However, when I run sudo gitlab-ctl start several of the services fail to start. some seem to quit and restart, as I’ve restarted several times and the list seems to be different every time.
down: alertmanager: 0s, normally up, want up; run: log: (pid 1597) 5356s
down: gitaly: 1s, normally up, want up; run: log: (pid 1591) 5356s
down: gitlab-exporter: 1s, normally up, want up; run: log: (pid 1596) 5356s
down: gitlab-kas: 1s, normally up, want up; run: log: (pid 1588) 5356s
down: gitlab-workhorse: 1s, normally up, want up; run: log: (pid 1592) 5356s
run: logrotate: (pid 62700) 606s; run: log: (pid 1584) 5356s
run: nginx: (pid 62757) 606s; run: log: (pid 1585) 5356s
run: node-exporter: (pid 62796) 605s; run: log: (pid 1587) 5356s
run: postgres-exporter: (pid 62855) 605s; run: log: (pid 1590) 5356s
down: postgresql: 1s, normally up, want up; run: log: (pid 1593) 5356s
down: prometheus: 1s, normally up, want up; run: log: (pid 1598) 5356s
run: puma: (pid 105145) 1s; run: log: (pid 1595) 5356s
down: redis: 1s, normally up, want up; run: log: (pid 1594) 5356s
run: redis-exporter: (pid 66876) 547s; run: log: (pid 1586) 5356s
run: sidekiq: (pid 105179) 0s; run: log: (pid 1589) 5356s
What did I miss?
You should really be using the Gitlab Backup and Restore procedures outlined in the Gitlab docs. Using rsync is hit-and-miss at best due to the fact, the UID/GID of your accounts under Mint20 will be different for Gitlab under Mint21. You can check/verify that by looking at /etc/passwd on both machines, as well as /etc/group.
If you had a backup, you would restore the backup as per the Gitlab restore procedures which would more or less be:
- Install Gitlab on Mint 21.
- Copy /etc/gitlab/gitlab.rb and /etc/gitlab/gitlab-secrets.json from Mint20 to Mint21.
- Run gitlab-ctl reconfigure
- Follow Gitlab restore docs to restore backup which will exist under /var/opt/gitlab/backups on Mint 20 - copy that to /var/opt/gitlab/backups on Mint21, and use restore procedures.
More here: Back up and restore GitLab | GitLab
I tried that, it didn’t work either. That procedure seems to be written from the perspective that I am migrating between 2 machines. I’m not. When I’m booted into mint21, mint20 is obviously not running, so there is no need to stop, modify settings, reconfigure, etc on mint20. Mint21 was stopped. I can’t see why copying the files won’t work unless I missed something.
Those instructions also entirely left out the restore step. It talks about copying the files over and running reconfigure, then - nothing else.
I see your point about the account uid/gid. I’ll have to check that, although they seemed to be the same.
Except that you are. Just because Mint20 and Mint21 are on the same machine, they are still two different operating systems that are not running at the same time - which you already mentioned. Dual-booting on the same machine doesn’t change the fact that it is two separate Linux installations. The fact you need to run it under Mint21, means it is no different than a machine migration, or using backup/restore as per the docs.
The instructions for restore are in the docs: Restore GitLab | GitLab which was two options lower on the menu from the original link that I gave you. And in particular other than the config copying, this direct to the particular section: Restore GitLab | GitLab
If the UID/GID are the same, then there is no reason why it shouldn’t work. Either way, you still have to install the gitlab-ce or gitlab-ee package - whichever version you were using under Mint20, and it must be the exact same version for it to run under Mint21 and be able to restore it.
The procedures for backup/restore do work, because I’ve used them countless times already myself as have many others.
In theory, assuming UID/GID are the same, and files are copied with rsync correctly, there should be no reason that it doesn’t work. You do need gitlab-ce or gitlab-ee installed first, before doing the rsync since there are systemd scripts as well. Just copying directories is not enough. People have done it and it has worked, however it never worked for me and I’ve never tried since, because the backup/restore always works and is far easier than messing around with rsync, etc. But each have their own preferences on what they like best
Success! the restore procedure worked. Thanks!