1.這里是從自己公司的源下載的rpm包,需要換成自己的
2.從12的最后一個版本升級到14的最后一個版本
# 停服務
[root@docker test]# gitlab-ctl stop puma && gitlab-ctl stop sidekiq && gitlab-ctl stop nginx && gitlab-ctl status# 進入 Rails 控制臺
gitlab-rails console# 查詢項目 read-only 打開的
projects = Project.where(repository_read_only: true)# 關閉項目的 read-only
projects.each do |p|p.update!(repository_read_only:nil)
end# 退出
exit# 存儲庫遷移
[root@gitlab_ae ~]# gitlab-rake gitlab:storage:migrate_to_hashed# 重啟gitlab
[root@gitlab_ae ~]# gitlab-ctl restart# 存儲庫遷移
[root@gitlab_ae ~]# gitlab-rake gitlab:storage:migrate_to_hashed# 查看傳統存儲項目
[root@gitlab_ae ~]# gitlab-rake gitlab:storage:list_legacy_projects# 可以導出或者刪除有問題的存儲庫,方便以后恢復# 重新檢查傳統存儲項目
[root@gitlab_ae ~]# gitlab-rake gitlab:storage:list_legacy_projects
升級到14.0.12版本
[root@docker test]# gitlab-ctl stop puma && gitlab-ctl stop sidekiq && gitlab-ctl stop nginx && gitlab-ctl status
[root@docker test]# wget https://mirrors.xurikeji.com/package/gitlab-ce/gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm
[root@docker test]# rpm -Uvh gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm
Warnings:
The version of the running postgresql service is different than what is installed.
Please restart postgresql to start the new version.sudo gitlab-ctl restart postgresql
[root@gitlab_ae ~]# gitlab-ctl restart postgresql
[root@gitlab_ae ~]# gitlab-ctl reconfigure
[root@gitlab_ae ~]# gitlab-ctl restart
升級到14.3.6版本
[root@docker test]# gitlab-ctl stop puma && gitlab-ctl stop sidekiq && gitlab-ctl stop nginx && gitlab-ctl status
[root@docker test]# wget https://mirrors.xurikeji.com/package/gitlab-ce/gitlab-ce-14.3.6-ce.0.el7.x86_64.rpm
[root@docker test]# rpm -Uvh gitlab-ce-14.3.6-ce.0.el7.x86_64.rpmWarnings:
The version of the running redis service is different than what is installed.
Please restart redis to start the new version.sudo gitlab-ctl restart redisRunning handlers complete
Chef Infra Client failed. 31 resources updated in 58 secondsWarnings:
The version of the running redis service is different than what is installed.
Please restart redis to start the new version.sudo gitlab-ctl restart redis===
There was an error running gitlab-ctl reconfigure. Please check the output above for more
details.
===warning: %posttrans(gitlab-ce-14.3.6-ce.0.el7.x86_64) scriptlet failed, exit status 1[root@docker test]# sudo gitlab-ctl restart redis
[root@docker test]# gitlab-ctl restart
#這里reconfigure會報錯:需要登到gitlab看后臺遷移的任務全部成功才能配置成功,帶上鏈接
#https://docs.gitlab.com/ee/user/admin_area/monitoring/background_migrations.html#database-migrations-failing-because-of-batched-background-migration-not-finished
[root@docker test]# sudo gitlab-ctl reconfigure
[root@docker test]# gitlab-ctl restart
升級到14.3.6版本
[root@docker test]# gitlab-ctl stop puma && gitlab-ctl stop sidekiq && gitlab-ctl stop nginx && gitlab-ctl status
[root@docker test]# wget https://mirrors.xurikeji.com/package/gitlab-ce/gitlab-ce-14.9.5-ce.0.el7.x86_64.rpm
[root@docker test]# rpm -Uvh gitlab-ce-14.9.5-ce.0.el7.x86_64.rpm
# 需要等待很長時間,卡在 ...AddStatusColumnToSecurityScansTable...
[root@docker test]# gitlab-ctl reconfigure
#這里后臺雖然也有遷移的任務,但是沒事兒,不用管,不會影響下個版本升級
[root@docker test]# gitlab-ctl restart
升級到14.10.5版本
[root@docker test]# gitlab-ctl stop puma && gitlab-ctl stop sidekiq && gitlab-ctl stop nginx && gitlab-ctl status
[root@docker test]# wget https://mirrors.xurikeji.com/package/gitlab-ce/gitlab-ce-14.10.5-ce.0.el7.x86_64.rpm
[root@docker test]# rpm -Uvh gitlab-ce-14.10.5-ce.0.el7.x86_64.rpm
[root@docker test]# gitlab-ctl reconfigure
[root@docker test]# gitlab-ctl restart