5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitLab CE(omnibus)のマイナーバージョンアップ(11.6.2から11.9.4)

Last updated at Posted at 2019-04-02

前置き

自宅サーバのGitLabを最新バージョンにアップデートした時の手順を投稿します。
マイナーバージョンアップなので、特に問題なく終わりました。

  • 対象
    • GitLab CE Omunibus
  • バージョン
    • アップデート前: 11.6.2
    • アップデート後: 11.9.4(実施日の最新ver)
  • マシン環境
    • Ubuntu 16.04.5 LTS
    • 自宅サーバ(利用者1名)

実施内容

GitLabのバックアップ

マイナーバージョンのアップデートなので、恐らく問題ないだろうと思いつつ、でも念のため実施します。
バックアップ漏れがないように、アップデート直前にバックアップを取ります。

gitlab-rake gitlab:backup:create

ファイルは/var/opt/gitlab/backups/に生成されます。

パッケージ更新

インストール可能なパッケージ一覧を更新します。

apt-get update

現在のバージョンと更新可能なバージョンを確認しておきます。

## apt-cache policy gitlab-ce
gitlab-ce:
  Installed: 11.6.2-ce.0
  Candidate: 11.9.4-ce.0

続いてパッケージを最新に更新します。
自分の場合、「ついでにインストール済みのパッケージも全部更新しよう」と思ったので、upgradeを実施しました(あまりよくないかも)。

apt-get upgrade

GitLabだけを更新したい場合は以下のように書くことができます。

# 最新に更新
apt-get install gitlab-ce

# バージョン指定して更新
apt-get install gitlab-ce=11.9.4-ce.0

GitLabの更新

/etc/gitlab/gitlab.rbを表示し、GitLabの設定が間違っていないことを確認します。
今回はマイナーバージョンアップなので全く問題なさそうでした。

続いて以下を実行してGitLab自身を更新します。

gitlab-ctl reconfigure

reconfigureが完了すると、最後の方に以下の出力がありました。

Deprecations:
== Prometheus ==
Detected Prometheus version 1.x. Version 1.x has been deprecated and support will be removed in GitLab version 12.0.
To upgrade to Prometheus 2.x, use `gitlab-ctl prometheus-upgrade` command.
Running this command will migrate all your existing data to format supported by Prometheus 2.x.
This can be a time consuming operation. To skip migrating the data, and instead remove and start fresh, run `gitlab-ctl prometheus-upgrade --skip-data-migration`.
Check https://docs.gitlab.com/omnibus/update/gitlab_11_changes.html#114 for details.

Prometheusのバージョンがdeprecated(非推奨)とのことなので、表示された通りにコマンドを実行します。

gitlab-ctl prometheus-upgrade

動作確認

コマンド操作は以上で終了です。
最後にブラウザからGitLabにアクセスし、特に問題ないことが確認できたら更新完了です。

以下はAdmin Areaにアクセスして、バージョンが上がっていることを確認した時のスクリーンショットです。

gitlab.png

最後に

とても簡単に作業完了となりました。
OSSで脆弱性の心配とかもあるので、定期的にアップデートするようにしたいですね。
また、まとめてバージョンを上げるよりも、少しずつバージョンを上げていった方がトータルで楽できると思います(以前ver8から10に上げて大変だった経験あり)。

5
4
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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?