Skip to content
Snippets Groups Projects
Select Git revision
  • ag-test
  • rs-test
  • master default protected
  • test-me-pa
  • mksionek-master-patch-52381
  • new-branch-10
  • test-conflicts
  • test-suggestions
  • alejandro-test
  • patch-25
  • winh-test-image-doscussion
  • stg-lfs-image-test-2
  • stg-lfs-image-test
  • test42016
  • issue_42016
  • issue-32709
  • add-codeowners
  • ClemMakesApps-master-patch-62759
  • bvl-staging-test
  • bvl-merge-base-api
  • v9.2.0-rc6 protected
  • v9.2.0-rc5 protected
  • v9.2.0-rc4 protected
  • v9.2.0-rc3 protected
  • v9.1.4 protected
  • v9.2.0-rc2 protected
  • v9.2.0-rc1 protected
  • v9.1.3 protected
  • v8.17.6 protected
  • v9.0.7 protected
  • v9.1.2 protected
  • v9.1.1 protected
  • v9.2.0.pre protected
  • v9.1.0 protected
  • v9.1.0-rc7 protected
  • v9.1.0-rc6 protected
  • v9.0.6 protected
  • v9.1.0-rc5 protected
  • v9.1.0-rc4 protected
  • v9.1.0-rc3 protected
40 results

upgrader.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.

    GitLab Upgrader

    DEPRECATED We recommend to switch to the Omnibus package and repository server instead of using this script.

    Although deprecated, if someone wants to make this script into a gem or otherwise improve it merge requests are welcome.

    Make sure you view this upgrade guide from the 'master' branch for the most up to date instructions.

    GitLab Upgrader - a ruby script that allows you easily upgrade GitLab to latest minor version.

    For example it can update your application from 6.4 to latest GitLab 6 version (like 6.6.1).

    You still need to create a backup and manually restart GitLab after running the script but all other operations are done by this upgrade script.

    If you have local changes to your GitLab repository the script will stash them and you need to use git stash pop after running the script.

    GitLab Upgrader is available only for GitLab version 6.4.2 or higher.

    This script does NOT update gitlab-shell, it needs manual update. See step 5 below.

    0. Backup

    cd /home/git/gitlab
    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

    1. Stop server

    sudo service gitlab stop

    2. Run GitLab upgrade tool

    Please replace X.X.X with the latest GitLab release.

    GitLab 7.9 adds nodejs as a dependency. GitLab 7.6 adds libkrb5-dev as a dependency (installed by default on Ubuntu and OSX). GitLab 7.2 adds pkg-config and cmake as dependency. Please check the dependencies in the installation guide.

    cd /home/git/gitlab
    sudo -u git -H ruby -Ilib -e 'require "gitlab/upgrader"' -e 'class Gitlab::Upgrader' -e 'def latest_version_raw' -e '"vX.X.X"' -e 'end' -e 'end' -e 'Gitlab::Upgrader.new.execute'
    
    # to perform a non-interactive install (no user input required) you can add -y
    # sudo -u git -H ruby -Ilib -e 'require "gitlab/upgrader"' -e 'class Gitlab::Upgrader' -e 'def latest_version_raw' -e '"vX.X.X"' -e 'end' -e 'end' -e 'Gitlab::Upgrader.new.execute' -- -y

    3. Start application

    sudo service gitlab start
    sudo service nginx restart

    4. Check application status

    Check if GitLab and its dependencies are configured correctly:

    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

    If all items are green, then congratulations upgrade is complete!

    5. Upgrade GitLab Shell

    GitLab Shell might be outdated, running the commands below ensures you're using a compatible version:

    cd /home/git/gitlab-shell
    sudo -u git -H git fetch
    sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`

    One line upgrade command

    You've read through the entire guide and probably already did all the steps one by one.

    Below is a one line command with step 1 to 5 for the next time you upgrade.

    Please replace X.X.X with the latest GitLab release.

    cd /home/git/gitlab; \
      sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \
      sudo service gitlab stop; \
      sudo -u git -H ruby -Ilib -e 'require "gitlab/upgrader"' -e 'class Gitlab::Upgrader' -e 'def latest_version_raw' -e '"vX.X.X"' -e 'end' -e 'end' -e 'Gitlab::Upgrader.new.execute' -- -y; \
      cd /home/git/gitlab-shell; \
      sudo -u git -H git fetch; \
      sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`; \
      cd /home/git/gitlab; \
      sudo service gitlab start; \
      sudo service nginx restart; \
      sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production