gitlab 12升级14(解决各种报错问题)

1.这里是从自己公司的源下载的rpm包,需要换成自己的

2.从12的最后一个版本升级到14的最后一个版本

bash 复制代码
# 停服务
[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版本

bash 复制代码
[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版本

bash 复制代码
[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.rpm

Warnings:
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

Running handlers complete
Chef Infra Client failed. 31 resources updated in 58 seconds

Warnings:
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版本

bash 复制代码
[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版本

bash 复制代码
[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
相关推荐
A ?Charis12 小时前
Gitlab-runner running on Kubernetes - hostAliases
容器·kubernetes·gitlab
秋说19 小时前
开源代码管理平台Gitlab如何本地化部署并实现公网环境远程访问私有仓库
gitlab·源代码管理
极小狐1 天前
驭码上新,AI Code Review、基于代码库的知识问答,让研发起飞
gitlab·devsecops·devops·极狐gitlab·安全合规
蚊子不吸吸1 天前
DevOps开发运维简述
linux·运维·ci/cd·oracle·kubernetes·gitlab·devops
花开莫与流年错_5 天前
GitLab代码仓管理安装配置使用
运维·服务器·git·gitlab·配置·代码仓
极小狐7 天前
如何打开/关闭 GitLab 的版本检查功能?
gitlab·devsecops·devops·极狐gitlab·安全合规
玉石俱焚ing8 天前
ubuntu20上部署gitlab并开启ipv6访问
运维·gitlab
謬熙8 天前
GitHub、Gitee、GitLab介绍
gitee·gitlab·github
云围9 天前
Soanrquber集成Gitlab 之 导入Gitlab项目
运维·ci/cd·gitlab·devops
云围9 天前
Soanrquber集成Gitlab 之 gitlab用户配置和身份验证
ci/cd·gitlab·github·devops