LoginSignup
5
7

More than 5 years have passed since last update.

gitlabのアップデート

Posted at

CentOS6.5でgitlab8.13.5(CommunityEdition)を運用中。

yum updateをした上でgitlabのlatestにアップデートしたい。

aws上でcentos6.5を立てて検証

centos6.5のSSHアクセスユーザーはrootだった。

公式インストール手順

EnterpriseEditionではなくCommunityEditionのレポジトリを追加する。

インストールの候補は多数出てくるので省略している部分もある。

# cat /etc/redhat-release 
CentOS release 6.5 (Final)
# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
# yum --showduplicate list gitlab-ce
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Available Packages
gitlab-ce.x86_64                  7.10.0~omnibus-1                     gitlab_gitlab-ce
gitlab-ce.x86_64                  7.14.3-ce.1.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  8.0.0-ce.0.el6                       gitlab_gitlab-ce
gitlab-ce.x86_64                  8.13.5-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  8.13.12-ce.0.el6                     gitlab_gitlab-ce
gitlab-ce.x86_64                  8.17.8-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  9.0.0-ce.0.el6                       gitlab_gitlab-ce
gitlab-ce.x86_64                  9.5.10-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  10.0.0-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  10.8.7-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  11.0.0-ce.0.el6                      gitlab_gitlab-ce
gitlab-ce.x86_64                  11.2.3-ce.0.el6                      gitlab_gitlab-ce

rpmをダウンロードしてインストールする。その後も対象rpmをダウンロードしアップデートしていく。

飛ばして上げ過ぎると必要なバージョンに一度アップデートしろとメッセージが出る。

# yum install --downloadonly --downloaddir=/tmp/gitlab gitlab-ce-8.13.5-ce.0.el6
# ls /tmp/gitlab/
gitlab-ce-8.13.5-ce.0.el6.x86_64.rpm
# gitlab-ctl reconfigure

v8系からv9系にアップデート。ただし、その前にyum updateを済ませる。

# yum install --downloadonly --downloaddir=/tmp/gitlab gitlab-ce-9.0.0-ce.0.el6
# ls /tmp/gitlab/
gitlab-ce-8.13.5-ce.0.el6.x86_64.rpm  gitlab-ce-9.0.0-ce.0.el6.x86_64.rpm
# uname -a
Linux ip-172-31-3-50 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# yum --showduplicate list kernel
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
kernel.x86_64               2.6.32-431.el6                    @CentOS6-Base/$releasever
Available Packages
kernel.x86_64               2.6.32-754.el6                    base                     
kernel.x86_64               2.6.32-754.2.1.el6                updates                  
kernel.x86_64               2.6.32-754.3.5.el6                updates 
# yum update
# shutdown -r now
# uname -a
Linux ip-172-31-3-50 2.6.32-754.3.5.el6.x86_64 #1 SMP Tue Aug 14 20:46:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# rpm -Uvh /tmp/gitlab/gitlab-ce-9.0.0-ce.0.el6.x86_64.rpm
# cat /etc/redhat-release 
CentOS release 6.10 (Final)

v9系からv10系にアップデート

# yum install --downloadonly --downloaddir=/tmp/gitlab gitlab-ce-10.0.0-ce.0.el6
# ls /tmp/gitlab/
gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm  gitlab-ce-9.0.0-ce.0.el6.x86_64.rpm
gitlab-ce-8.13.5-ce.0.el6.x86_64.rpm
# rpm -Uvh /tmp/gitlab/gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm

v10系からv11系にアップデート

10.8を経由しろとエラーが出たので10.8を経由する。

# yum install --downloadonly --downloaddir=/tmp/gitlab gitlab-ce-11.2.3-ce.0.el6
# ls /tmp/gitlab/
gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm  gitlab-ce-8.13.5-ce.0.el6.x86_64.rpm
gitlab-ce-11.2.3-ce.0.el6.x86_64.rpm  gitlab-ce-9.0.0-ce.0.el6.x86_64.rpm
# rpm -Uvh /tmp/gitlab/gitlab-ce-11.2.3-ce.0.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
gitlab preinstall: It seems you are upgrading from 10.x version series
gitlab preinstall: to 11.x series. It is recommended to upgrade
gitlab preinstall: to the last minor version in a major version series first before
gitlab preinstall: jumping to the next major version.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
gitlab preinstall: and upgrade to 10.8 first.
error: %pre(gitlab-ce-11.2.3-ce.0.el6.x86_64) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping gitlab-ce-11.2.3-ce.0.el6

# yum --showduplicate list gitlab-ce | grep 10.8
gitlab-ce.x86_64               8.10.8-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.0-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.1-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.2-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.3-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.4-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.5-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.6-ce.0.el6                  gitlab_gitlab-ce
gitlab-ce.x86_64               10.8.7-ce.0.el6                  gitlab_gitlab-ce
# yum install --downloadonly --downloaddir=/tmp/gitlab gitlab-ce-10.8.7-ce.0.el6
# ls /tmp/gitlab/
gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm  gitlab-ce-8.13.5-ce.0.el6.x86_64.rpm
gitlab-ce-10.8.7-ce.0.el6.x86_64.rpm  gitlab-ce-9.0.0-ce.0.el6.x86_64.rpm
gitlab-ce-11.2.3-ce.0.el6.x86_64.rpm
# rpm -Uvh /tmp/gitlab/gitlab-ce-10.8.7-ce.0.el6.x86_64.rpm

# rpm -Uvh /tmp/gitlab/gitlab-ce-11.2.3-ce.0.el6.x86_64.rpm

不安な場合は個別にバックアップを取っておくこともできる。

# gitlab-rake -T | grep 'gitlab:backup'
rake gitlab:backup:create                                           # GitLab | Create a backup of the GitLab system
rake gitlab:backup:restore                                          # GitLab | Restore a previously created backup
# gitlab-rake gitlab:backup:create
# ls /var/opt/gitlab/backups/
1536214543_gitlab_backup.tar             1536216066_2018_09_06_10.0.0_gitlab_backup.tar  1536216908_2018_09_06_11.2.3_gitlab_backup.tar
1536215261_2018_09_06_gitlab_backup.tar  1536216474_2018_09_06_10.8.7_gitlab_backup.tar

logoのascii-artが見れて良かった

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
5
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7