Migrate from 5.3 to 7.8


I have a working gitlab 5.3 ubuntu 12.04 server, and i would like to setup a new SL6 server with gitlab 7.8

Given the “distance” between my two installations i tried to make a clean installation, then import the databases following this for instance:

However, the database structure has changed and this obviously fails. Would you have any advice for me ? The old server is in production, so I would like to avoid any dangerous manipulation on that one.



Here’s what I would do.

  1. Take a backup from 5.3.
  2. Setup a VM with 5.3 installed (this might be tricky, but try to follow the guide on 5-3-stable branch).
  3. Restore the backup to the VM.
  4. Follow the guides to migrate to latest version (you can skip multiple versions, check in /doc folder).
  5. Follow the link to convert to postgres.
  6. Ensure everything works, take a new backup for version 7.8.
  7. Install omnibus package in SL6.
  8. Restore backup.

Of course this means that your production server might need to be inaccessible until the migration process finishes. You can try the VM way and if you feel comfortable, schedule a downtime window with your team to update prod.

Good luck :sunglasses:


However there’s another problem with that : I would like to change the directory where the data and repositories will be placed (on a nfs space, on my central backuped server). Following your advices, I can get to the point where I have a working 7.8 instance, but how to move everything to the right place afterwards ?

I started by upgrading to 5.4 as it looks like a good starting point tgo get to 6, but I got stuck there:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

while doing:

sudo -u git -H bundle install --without development test mysql --deployment

EDIT : just needde to install posgres devel files. I was able to upgrade to 5.4, I am now going to 6.0. Yay !

The GitLab package comes with a lot of configuration options. When you have time you should carefully read the README and the various docs. All is configured by /etc/gitlab/gitlab.rb. For all the options see the gitlab.rb.template.

For changing the data dir you’ll want to set the git_data_dir option.

Since your initial install was with mysql the above command should be:

sudo -u git -H bundle install --without development test postgres --deployment

Be careful to set the right database.

Thanks, i eventually figured that part :smile:

About data, i was more worried about what would happen to my data if i changed the location in gitlab.rb : would the data be moved to the new location or would the installation only point there ? Then I have to move evrything by hand (easy) and to change ownerships accordingly (less easy).

Late reply, but as I was informed by @marin some time ago, the data do not move automatically, just the location changes.

thanks, I realized that in the process but forgot to update here. In my case, I wanted to put the data on a nfs mounted space for backup reasons, but then the config scripts ceased working properly as they do actions as ‘root’ while my nfs system doesn’t allow this.

I could have set an exception, but I prefer having as few as them as possible.

thanks anyway !