Cannot upgrade gitlab from 7.9.4

486 views Asked by At

according to this:

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/upgrader.md

I try to upgrade my instance. It used to work before:

git@myhost:~/gitlab$ 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
GitLab 7 upgrade tool
Your version is 7.9.4
Latest available version for GitLab 7 is Unknown
/home/git/gitlab/lib/gitlab/upgrader.rb:30:in `>=': comparison of Gitlab::VersionInfo with Gitlab::VersionInfo failed (ArgumentError)
    from /home/git/gitlab/lib/gitlab/upgrader.rb:30:in `latest_version?'
    from /home/git/gitlab/lib/gitlab/upgrader.rb:11:in `execute'
    from -e:7:in `<main>'

I don't know much ruby, but I suppose there's something wrong with 'vX.X.X', as the newest version is 7.11.2. The script is now deprecated, but I don't want to use omnibus package.

1

There are 1 answers

0
nhofmann On

Just replace vX.X.X to the latest Version tag. For 7.11.3 the command is

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 '"v7.11.3"' -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