I've had my own gitlab installation for a few years. I built it long before it was easy to build and maintain. Originally I installed gitlab from source, on ubuntu, using mysql and apache. It's a real PITA to maintain given that omnibus installations are so much easier to maintain. (omnibus is geek-speek for "all-in-one"). In this post I'll cover the steps I did to pull off upgrading this to omnibus, switching to postgresql from mysql, apache to nginx, and ubuntu to centos (which is my new Linux standard).
I hope I'm not polluting the google cache with this info but I couldn't find a good guide for migrating gitlab:
- from ubuntu to centos (debian to rpm). No particular reason for this, just trying to make my migration even more complicated.
- from mysql to postgres (the latter is the preferred database for omnibus gitlab installations)
- from gitlab source to omnibus gitlab (also the "new" preferred method). My installation was ancient and was built from source and was a hobgob of crap that was in dire need of cleanup. I had some components installed as the gitlab user, some as the git user...it was a mess.
- from apache to nginx. The latter is the preferred web server. It always was. For some reason when I installed from source years ago I decided to use apache. Don't remember why, probably just nginx ignorance.
I really wanted to clean all of this up and get gitlab going correctly. At this point I was stuck on 7.14 because 8.x migrations required nginx and google go and I couldn't seem to get that working with apache. Again, ignorance...but this was just one more reason to do things correclty.
# install your new gitlab server with the same installation as your source server. In my case 7.14. Probably want to use omnibus. Make sure it's working to your specifications
# on source server...
#remove existing backups
rm -rf /home/git/gitlab/tmp/backups/*
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
scp tmp/backups/* root@destination:/var/opt/gitlab/backups
# the remainder of the tasks are performed on the destination server
sudo su -
sudo gitlab-ctl stop unicorn
sudo gitlab-rake gitlab:satellites:create
sudo chmod -R ug+rwX,o-rwx /var/opt/gitlab/git-data/repositories
sudo chmod -R ug-s /var/opt/gitlab/git-data/repositories
find /var/opt/gitlab/git-data/repositories -type d -print0 | sudo xargs -0 chmod g+s
sudo gitlab-rake gitlab:check SANITIZE=true
sudo gitlab-rake gitlab:check
You have just read "Migrating gitlab to omnibus from source, debian to rpm, apache to nginx, and mysql to postgresql" on davewentzel.com. If you found this useful please feel free to subscribe to the RSS feed.