コミュニティ版からエンタープライズ版へのソースからのアップグレード
doc/update
ディレクトリにあります。使用しているGitLabのエディション(CommunityやEnterprise)を変更せずに、例えば11.8から11.9のようにバージョンだけをアップグレードしたい場合は、Upgrading from sourceのドキュメントをご覧ください。
一般的なアップグレード手順
このガイドは、GitLab Community Edition が正しく設定され、テストされたインストールであることを前提としています。もし何か問題が発生したり、質問がある場合はsupport@gitlab.com
までご連絡ください。
すべての例で、EE_BRANCH
を使用しているバージョンの Enterprise Edition のブランチに、CE_BRANCH
を Community Edition のブランチに置き換えてください。ブランチ名は、Enterprise Edition の場合はmajor-minor-stable-ee
という形式を使用し、Community Edition の場合はmajor-minor-stable
という形式を使用します。たとえば、11.8.0 の場合は以下のブランチを使用します:
- エンタープライズ版:
11-8-stable-ee
- コミュニティ版:
11-8-stable
0. バックアップ
万が一に備えてバックアップを取っておきましょう:
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
MySQLを使ったインストールでは、データベースのバージョンでGitLabユーザーに “LOCK TABLES “権限を与える必要があるかもしれません。
1. サーバー停止
sudo service gitlab stop
2. EEコードを取得
cd /home/git/gitlab
sudo -u git -H git remote add -f ee https://gitlab.com/gitlab-org/gitlab.git
sudo -u git -H git checkout EE_BRANCH
3. ライブラリ、マイグレーションなどのインストール
cd /home/git/gitlab
sudo -u git -H bundle install --deployment --without development test mysql aws kerberos
# Optional: clean up old gems
sudo -u git -H bundle clean
# Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Compile GetText PO files
sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production
# Update node dependencies and recompile assets
sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production NODE_OPTIONS="--max_old_space_size=4096"
# Clean up cache
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
4. インストールgitlab-elasticsearch-indexer
インストール手順に従ってください。
5. 申し込み開始
sudo service gitlab start
sudo service nginx restart
6. 申込状況の確認
GitLabとその環境が正しく設定されているか確認してください:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
見落としがないかどうか、より徹底的なチェックが必要です:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
すべての項目が緑色になっていれば、アップグレード完了です!
状況が悪化した場合は、以前のバージョン(コミュニティ版)に戻してください。
1. コードを以前のバージョンに戻します。
cd /home/git/gitlab
sudo -u git -H git checkout CE_BRANCH
2. バックアップからのリストア
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
バージョン別の手順
GitLabのバージョンによっては、Community EditionからEnterprise Editionにアップグレードする際に追加の手順が必要な場合があります。 そのような手順が必要な場合は、以下にバージョンごとに記載されています。