CodeMan

Each of us must find a way to love the world. You have found yours.

0%

Gitlab跨版本升级从gitlab-ee-12.7.5到gitlab-ee-14.0.1

查看版本号

1
gitlab-rake gitlab:env:info

备份

1
gitlab-rake gitlab:backup:create

升级路线

官方路径
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.12.Z -> latest 14.0.Z

自动备份目录

/etc/gitlab/config_backup

升级

当前版本:gitlab-ee-12.7.5-ee.0.el7.x86_64
目标版本:gitlab-ee-14.0.1-ee.0.el7.x86_64

1
2
3
4
5
6
7
8
9
10
11
12
13
yum install gitlab-ee-12.9.5
yum install gitlab-ee-12.10.14
yum install gitlab-ee-13.0.14
yum install gitlab-ee-13.1.11
yum install gitlab-ee-13.5.4
yum install gitlab-ee-13.6
yum install gitlab-ee-13.6.0
yum install gitlab-ee-13.8.0
yum install gitlab-ee-13.9.0
yum install gitlab-ee-13.12.0
yum install gitlab-ee-13.12.5
yum install gitlab-ee-14.0.1

每次升级过程中都会自动当前配置到配置备份目录

1
2
3
4
5
[root@ip-172-31-17-151 ~]# ls /etc/gitlab/config_backup
gitlab_config_1624679624_2021_06_26.tar gitlab_config_1624682328_2021_06_26.tar gitlab_config_1624683553_2021_06_26.tar gitlab_config_1624684600_2021_06_26.tar
gitlab_config_1624680821_2021_06_26.tar gitlab_config_1624682595_2021_06_26.tar gitlab_config_1624683960_2021_06_26.tar gitlab_config_1624684881_2021_06_26.tar
gitlab_config_1624681207_2021_06_26.tar gitlab_config_1624683048_2021_06_26.tar gitlab_config_1624684242_2021_06_26.tar

查看升级后版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
gitlab-rake gitlab:backup:create

[root@ip-172-31-17-151 ~]# gitlab-rake gitlab:env:info

System information
System:
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.7.2p137
Gem Version: 3.1.4
Bundler Version:2.1.4
Rake Version: 13.0.3
Redis Version: 6.0.14
Git Version: 2.32.0
Sidekiq Version:5.2.9
Go Version: unknown

GitLab information
Version: 14.0.1-ee
Revision: 38151bb98b6
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 12.4
URL: https://code.xxx.com
HTTP Clone URL: https://code.xxx.com/some-group/some-project.git
SSH Clone URL: git@code.xxx.com:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version: 13.19.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git


注:整个升级过程不需要关闭Gitlab服务

停机

1
gitlab-ctl stop

启动

1
gitlab-ctl start