Upgrading GitLab from 6.2 to 8.5

Hi

Sorry for the delayed response. Thanks for providing the info. Few things before embarking on the Upgrade.

  • The upgrade is a giant leap from 6.2 to 8.5. There are a lot of changes between 6.2 to 8.5. U can see the Change Log
  • Multiple steps are need to upgrade to latest, direct upgrade is not possible.
  • Gitlab backup can be restored on the same version of Gitlab version. Eg: 6.9 backup will go in to 6.9 only.
  • In Source code method of installation there was an option to use Mysql db, in Omnibus method installation Postgresql is used.
  • I recommend you to change to Omnibus method because it is very simple, easy to maintain, easy to manage upgrades.
  • In source code method of installation if you have used mysql DB, during conversion to Omnibus method u might need to convert it using Mysql to Postgresql converter.

Since your installation is on source method Gitlab 6.2. Please try to do the following.

  1. Upgrade your Gitlab (source method) from 6.2 to 6.6 in source method.
  2. Take a backup from the Gitlab 6.6, now you have Gitlab backup (source method)
  3. I assume your installation has Mysql database as back end. (check it in /home/git/gitlab/config/database.yml file)
  4. Now if you extract the backup file you will find db/, repositories/, uploads/ and backup_information.yml
  5. You need to remove the database.sql file from db/ folder and replace it with a postgresql database sql file.
  6. Please use this link to convert your Mysql db file to Postgress sql , carefully read and follow the steps in this link and convert your DB file. Link: Mysql2PostgresqlConvertion
  7. Check the ownership and permissions of the db file,
  8. From step 6 you got your Postgre compatible db file, just replace it in the db directory.
  9. Change the permission and ownership of the file to git , (chmod 644/700 database.sql, chow git:git database.sql)
  10. Compress the all the files once again with same file name. (tar -cvf 1234XX_gitlab_backup.tar db uploads repos backup_information.yml)
  11. Download Gitlab 6.6 omnibus rpm from Gitlab Archives
  12. Restore the backup on Gitlab 6.6. Now your installation is Omnibus Gitlab.
  13. Take small steps upgrade your Gitlab in following steps. Upgrade Instructions
  14. Gitlab 6.6 to Gitlab 6.9

14 A. Till 6.9 GitLab creates git user as Normal user , ie., userid < 500 (RHEL/CentOS), after 7.1 we need to change git user type to system user, other wise git clone problem would arise.
14 B. run following commands to modify user ;
groupmod -g 496 git (chose available user id if 496 is not available)
usermod -u 496 -g 496 -d /var/opt/gitlab -s /bin/sh git
chown 496:496 gitlab-shell.log
chown git:git application.log
chown git:git production.log
chown git:git satellites.log
chmod 0666 production.log

  1. Gitlab 6.9 to Gitlab 7.1
  2. Gitlab 7.1 to Gitlab 7.4
  3. Gitlab 7.4 to Gitlab 7.6
  4. Gitlab 7.6 to Gitlab 8.0
  5. Gitlab 8.0 to Gitlab 8.3
  6. Gitlab 8.3 to Gitlab 8.5
  7. The reason for multiple steps is, there are multiple db changes between the versions, during upgrade db migration will fail, due different db errors.
  8. Run Rake tests in between every steps to check the health of the gitlab installation.
    Rake tests:
    sudo gitlab-rake gitlab:env:info --trace
    sudo gitlab-rake gitlab:gitlab_shell:check --trace
    sudo gitlab-rake gitlab:sidekiq:check --trace
    sudo gitlab-rake gitlab:app:check --trace
    sudo gitlab-rake db:migrate:status --trace
    sudo gitlab-rake gitlab:check SANITIZE=true --trace
    (try to solve all issues before progressing to next step of upgrade, u can ignore this error which comes every time )
  9. Configure your HTTPS/LDAP etc if needed.
  • During all these steps you will encounter many errors and issues which you need to solve by yourself and take help from Internet/Gitlab Forum.
  • By the end of this process you will get a lot of information about gitlab.
  • I suggest you to try this on a test server and then do this upgrade on the actual server.
  • All the steps are based on my experience of upgrading our Gitlab installation from Gitlab 6.9 source method to 8.5 Omnibus method with over 1200 users and 50GB user data for our client,
    Good Luck !!

Edited: Added Steps 14 A & B

3 Likes