本地部署的GitLab升级指南
gitLab 升级版本路线
gitlab 不支持大版本之间直接升级,需要升级到当前版本的最新版本,然后再升级下一个版本。
- GitLab 8:
8.11.Z>8.12.0>8.17.7 - GitLab 9:
9.0.13>9.5.10 - GitLab 10:
10.0.7>10.8.7 - GitLab 11:
11.0.6>11.11.8 - GitLab 12:
12.0.12>12.1.17>12.10.14 - GitLab 13:
13.0.14>13.1.11>13.8.8>13.12.15 - GitLab 14:
14.0.12>14.3.6>14.9.5>14.10.5 - GitLab 15:
15.0.5>15.1.6(for GitLab instances with multiple web nodes) >15.4.6>15.11.13 - GitLab 16:
16.0.8>16.1.6>16.2.9>16.3.7>16.7.z
官方升级路线说明获取地址:https://docs.gitlab.com/ee/update/index.html#upgrade-paths
版本升级包下载,清华大学开源软件镜像站
清华大学镜像站:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/
gitlab-ces代表社区版。
升级前检查
1 | |
出现任何错误参考官方解决办法:Create a GitLab upgrade plan | GitLab
开始升级操作
1 | |
升级中可能遇到的错误。
运行gitlab-ctl reconfigure时错误:
rails_migration[gitlab-rails] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[migrate gitlab-rails database ] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/resources/rails_migration.rb line 16) had an error: Mixlib::ShellOut::ShellCommandFailed: Command execution failed. STDOUT/STDERR suppressed for sensitive resource处理办法:执行 下列命令
sudo gitlab-rake db:migratesudo gitlab-rake gitlab:background_migrations:finalize[ProjectNamespaces::BackfillProjectNamespaces,projects,id,'[null\,"up"]']- 再次执行
sudo gitlab-ctl reconfigure
升级时
RuntimeError: gitlab_rails['smtp_tls'] and gitlab_rails['smtp_enable_starttls_auto'] are mutually exclusive错误。错误原因是:在配置文件
/etc/gitlab/gitlab.rb中,同时配置了smtp_tls和smtp_enable_starttls_auto为true,把其中一个设置为false就行了。具体哪一个设置为false,就要看你的smtp供应商提供的是什么加密协议。数据库版本错误
报错:
Retry the upgrade after upgrading your PostgreSQL version.原因: 从GitLab15版开始,PostgreSQL需要使用13以上版本。正常情况安装升级包时,会自动升级PostgreSQL版本。一些莫名原因造成升级失败,手动升级即可。
处理办法:
1
2
3
4#升级PostgreSQL默认升级到最新,可使用-V指定版本。
sudo gitlab-ctl pg-upgrade
#查询当前版本号。
sudo gitlab-psql select --version
PostgreSQL相关操作说明:https://docs.gitlab.com/omnibus/settings/database.html#gitlab-160-and-later