一、简介

gitlab的版本规则是:主版本(Major).次版本(Minor).补丁版本(Patch)

  • 主版本会在每年的五月22左右发布
  • 次版本会在每月22号左右发布
  • 补丁版本会不定时发布

版本升级说明

在同一个主要版本下,补丁版本和次要版本之间跳转是安全的。例如

  • 12.7.5 -> 12.10.5
  • 11.3.4 -> 11.11.1
  • 12.0.4 -> 12.0.12
  • 11.11.1 -> 11.11.8

而主版本升级,需要考虑版本是否可向后兼容与数据迁移,原则上先升级到当前主版本的最大次版本,然后在升级到下个主要版本最小次版本,依次往最新的版本进行升级

二、升级注意事项

1、版本升级路径

8.11.Z —> 8.12.0 —> 8.17.7 —> 9.5.10 —> 10.8.7 —> 11.11.8 —> 12.0.12 —> 12.1.17 —> 12.10.14 —> 13.0.14 —> 13.1.11 — > latest 13.Y.Z

当前版本 目标版本 支持的版本升级路径 备注
12.9.2

| 13.4.3

| 12.9.2 -> 12.10.14 -> 13.0.14 -> 13.4.3

| 需要两个中间版本:最终的12.10版本以及13.0

| | 11.5.0 | 13.2.10 | 11.5.0 -> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.10.14 -> 13.0.14 -> 13.2.10 | 需要五个中间版本:最终的11.11、12.0、12.1和12.10版本以及13.0 | | 11.3.4 | 12.10.14 | 11.3.4 -> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.10.14 | 需要三个中间版本:最终的11.11和12.0版本,再加上12.1 | | 10.4.5 | 12.9.5 | 10.4.5 -> 10.8.7 -> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.9.5 | 需要四个中间版本:10.8、11.11、12.0和12.1,然后是12.9.5 | | 9.2.6 | 12.2.5 | 9.2.6 -> 9.5.10 -> 10.8.7 -> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.2.5 | 需要五个中间版本:9.5、10.8、11.11、12.0、12.1,然后是12.2。 | | 8.13.4 | 11.3.4 | 8.13.4 -> 8.17.7 -> 9.5.10 -> 10.8.7 -> 11.3.4 | 8.17.7是版本8中的最新版本,9.5.10是版本9中的最新版本,10.8.7是版本10中的最新版本。 |

2、升级步骤

升级的步骤取决于Gitlab的部署方式

二进制包安装
参考文档:https://docs.gitlab.com/omnibus/update/
源码编译安装
参考文档:https://docs.gitlab.com/ee/update/upgrading_from_source.html
Docker方式安装
参考文档:https://docs.gitlab.com/omnibus/docker/README.html#update
Helm方式安装
参考文档:https://docs.gitlab.com/charts/installation/upgrade.html#steps

三、升级过程

下面提供下官网给出的升级方式(假装你看懂了)

Upgrade using the official repositories

All GitLab packages are posted to the GitLab package server. Five repositories are maintained:

  • gitlab/gitlab-ee: The full GitLab package that contains all the Community Edition features plus the Enterprise Edition ones.
  • gitlab/gitlab-ce: A stripped down package that contains only the Community Edition features.
  • gitlab/unstable: Release candidates and other unstable versions.
  • gitlab/nightly-builds: Nightly builds.
  • gitlab/raspberry-pi2: Official Community Edition releases built for Raspberry Pi packages.

If you have installed GitLab Community Edition or Enterprise Edition, then the official GitLab repository should have already been set up for you.

Upgrade to the latest version using the official repositories

If you upgrade GitLab regularly, for example once a month, you can upgrade to the latest version by using your package manager.

To upgrade to the latest GitLab version:

  1. # Ubuntu/Debian
  2. sudo apt update && sudo apt install gitlab-ee
  3. # RHEL/CentOS 6 and 7
  4. sudo yum install gitlab-ee
  5. # RHEL/CentOS 8
  6. sudo dnf install gitlab-ee
  7. # SUSE
  8. sudo zypper install gitlab-ee

For the GitLab Community Edition, replace gitlab-ee with gitlab-ce.

Upgrade to a specific version using the official repositories

Linux package managers default to installing the latest available version of a package for installation and upgrades. Upgrading directly to the latest major version can be problematic for older GitLab versions that require a multi-stage upgrade path. An upgrade path can span multiple versions, so you must specify the specific GitLab package with each upgrade.

To specify the intended GitLab version number in your package manager’s install or upgrade command:

1、Identify the version number of the installed package:

  1. # Ubuntu/Debian
  2. sudo apt-cache madison gitlab-ee
  3. # RHEL/CentOS 6 and 7
  4. yum --showduplicates list gitlab-ee
  5. # RHEL/CentOS 8
  6. dnf --showduplicates list gitlab-ee
  7. # SUSE
  8. zypper search -s gitlab-ee

2、Install the specific gitlab-ee package by using one of the following commands and replacing with the version you found in the previous step:

  1. # Ubuntu/Debian
  2. sudo apt install gitlab-ee=<version>
  3. # RHEL/CentOS 6 and 7
  4. yum install gitlab-ee-<version>
  5. # RHEL/CentOS 8
  6. dnf install gitlab-ee-<version>
  7. # SUSE
  8. zypper install gitlab-ee=<version>

For the GitLab Community Edition, replace gitlab-ee with gitlab-ce.

其他安装方式升级方式参考:https://docs.gitlab.com/ee/update/package/