Azure – Gitlab CE VM Marketplace Template – How to upgrade GitLab

The last time I really used Unix (yes, it was that long ago) I was working on Sparc Statison, so being dropped into the modern world of Linux has been a bit of a steep learning curve.  I recently had to deploy a GitLab Azure VM, the good thing is that this is a ARM template in the Azure Marketplace.  The bad news is that it’s version 8.6.4 which is quite old.  Couple this with it running on Ubuntu 14.04 this means there at a lot of updates to be done before its ready for production.  The first problem I hit was that if you just run the standard Linux update command “sudo apt upgrade” you end up breaking GitLab, this is because the PostgreSQL versions are different between GitLab 8.x and 10.x (the latest).  Now it would be great if the update program knew of this incompatibly but I guess this is one of the learning curves I mentioned.  So instead you have to upgrade GitLab 8.x to 9.x before going to 10.x.  So this post just covers the commands you need to run to achieve this, hopefully it’ll help out another Windows techy that is just starting their Linux adventure.

Ok…lets get started.  Note that the server is in a virgin state, I’ve not run any OS updates (because of the reasons above)

First SSH onto the GitLab server and login (a admin account makes the process a bit easier)

Update the package cache

sudo apt-get update

Upgrade GitLab to 9.5.6

sudo apt-get install gitlab-ce=9.5.6-ce.0

After the installation has finished run the GitLab configurator

sudo gitlab-ctl reconfigure

Now give GitLab a quick kick

sudo gitlab-ctl restart

Check that you can login to site, check version number which should now be 9.5.6.  Note that I had to wait for a few seconds before the GitLab site was up and running, so don’t panic if you see a 500, just hit refresh a few times and it’ll appear.

Now we can apply the OS updates, nice and easy

sudo apt upgrade

When the upgrade have finished just run the GitLab reconfigure again

sudo gitlab-ctl reconfigure

Followed by giving GitLab another kick

sudo gitlab-ctl restart

Check that you can login to site, check version number which should now be 10.x.x.  As above you might have to wait a few seconds for the web application to spool up thus you might get a 500 error on the first attempt to access GitLab, a refresh will clear it.

So that’s it….nice and simple when you know how…any now you do.



Leave a Reply

Your email address will not be published. Required fields are marked *