当前位置: 首页 > news >正文

gitlab备份-迁移-升级方案9.2.7升级到15版本最佳实践

背景

了解官方提供的版本的升级方案

- GitLab 8: 8.11.Z  8.12.0  8.17.7 
- GitLab 9: 9.0.13  9.5.10    9.2.7
- 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  latest 15.Y.Z
参考资料
官方文档
https://archives.docs.gitlab.com/15.11/ee/update/#upgrade-paths
清华大学开源软件镜像站
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
官方源
https://packages.gitlab.com/app/gitlab/gitlab-ce/search?dist=&filter=debs&page=147&q=
参考资料
https://blog.csdn.net/cfh0081/article/details/131393441
1. 数据备份
gitlab-rake gitlab:backup:create   #备份命令
备份目录
/data/backups
1706000135_2024_01_23_9.2.7_gitlab_backup.tar

在这里插入图片描述

2.迁移恢复

#忽略其他环境,建议使用centos7版本,方便后期升级

2.1 下载rpm包,方便后期升级

在这里插入图片描述
查看原来系统的版本

cat /var/opt/gitlab/gitlab-rails/VERSION  #检查升级的版本
2.1 恢复初始环境
rpm -i gitlab-ce-9.2.7-ce.0.el7.x86_64.rpm

在这里插入图片描述
注意修改配置 gitlab.rb
在这里插入图片描述

gitlab-ctl reconfigure
gitlab-ctl restart
2.2 恢复旧数据

cd 备份目录下

gitlab-rake gitlab:backup:restore BACKUP=1706000135_2024_01_23_9.2.7
gitlab-ctl reconfigure  #重新生成配置文件
gitlab-ctl restart  #重启服务
gitlab-ctl status   #检查服务是否正常启动
gitlab-rake gitlab:check SANITIZE=true  #检查 GitLab 实例的配置和运行环境是否正确
cat /var/opt/gitlab/gitlab-rails/VERSION  #检查升级的版本
2.3 版本升级

配置yum源

[gitlab-ce]
name=gitlab-ce
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
repo_gpgcheck=0
gpgcheck=0
enable=1
gpgkey=https://packages.gitlab.com/gpg.key

开始升级参照升级顺序进行升级,每次升级完成重新加载配置,重启服务

yum -y install gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm 
cat /var/opt/gitlab/gitlab-rails/VERSION  #检查版本
gitlab-ctl reconfigure  #重新加载配置
gitlab-ctl restart     #重启服务
为什么使用centos系统,

方便版本管理,后期升级完成后可以迁移其他系统。
rpm软件包提前下载是为了方便升级,下载地址如下
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

升级完成有如下提示

在这里插入图片描述
参考资料

https://blog.csdn.net/weixin_44093164/article/details/127869196?spm=1001.2101.3001.6650.9&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-127869196-blog-131288688.235%5Ev40%5Epc_relevant_anti_vip&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-127869196-blog-131288688.235%5Ev40%5Epc_relevant_anti_vip&utm_relevant_index=13
注意事项

12.10.14 -> 13.0.14升级注意

**12.10.14 -> 13.0.14**
此版本变动如下:
1、Puma代替unicorn作为默认web server
2、PostgreSQL最低版本提升到11。停止数据连接服务:
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
开始升级:
rpm -Uvh gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm
gitlab-ctl restart

14.0.12 -> 14.3.6 升级注意
报错
There was an error running gitlab-ctl reconfigure:
在这里插入图片描述
解决方案
gitlab:background_migrations:finalize… 该命令有可能执行多次,直到无报错即可

gitlab-ctl stopgitlab-ctl start postgresql
#复制刚才输出的命令 
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_builds_metadata,id, "["id"]\'["id_convert_to bigint"]]']
gitlab-rake db:migrate
gitlab-ctl reconfigure  #重新初始化
gitlab-ctl restart      #重起服务
http://www.lryc.cn/news/288707.html

相关文章:

  • redis面试题合集-基础
  • (Unity)C# 中的字符串格式化
  • 【项目日记(五)】第二层: 中心缓存的具体实现(上)
  • 使用PSIM软件生成DSP28335流水灯程序
  • 【iOS ARKit】人脸检测追踪基础
  • ES的一些名称和概念总结
  • Javaweb之SpringBootWeb案例之阿里云OSS服务集成的详细解析
  • 【GitHub项目推荐--不错的 Go 学习项目】【转载】
  • 【Git】windows系统安装git教程和配置
  • 办公技巧:PPT制作技巧分享,值得收藏
  • Google Chrome RCE漏洞 CVE-2020-6507 和 CVE-2024-0517 流程分析
  • 前端怎么监听手机键盘是否弹起
  • 本地生活服务平台加盟前景与市场分析
  • 蓝桥杯备战——7.DS18B20温度传感器
  • 黑盒测试用例的具体设计方法(7种)
  • docker镜像管理命令
  • 深入理解STM32中断处理机制
  • 基于机器学习的地震预测(Earthquake Prediction with Machine Learning)
  • 《30天自制操作系统》 第一周(D1-D7) 笔记
  • SQL注入:报错注入
  • K8s 安装部署-Master和Minion(Node)文档
  • OpenAI 降低价格并修复拒绝工作的“懒惰”GPT-4,另外ChatGPT 新增了两个小功能
  • springboot+value静态属性获取配置文件中的值的操作方法
  • Prometheus 架构全面解析
  • 把批量M3U8网络视频地址转为MP4视频
  • 联合 Maxlinear 迈凌 与 Elitestek 易灵思 - WPI 世平推出基于 FPGA 芯片的好用高效电源解决方案
  • Keycloak - docker 运行 前端集成
  • 架构篇27:如何设计计算高可用架构?
  • Python 有用的库模块
  • vivado DDS学习