当前位置:   article > 正文

gitlab 仓库迁移&升级_gitlab openssl::cipher::ciphererror ()

gitlab openssl::cipher::ciphererror ()

第一步,克隆项目到本地

完全迁移需将 --bare 换成 --mirror ,然后修改远程项目地址为第二步建的空项目,再执行push命令。使用--mirror推送时容易报错

git clone --bare http://127.0.0.1:8080/houtai/test.git

 第二步,在目标服务器新建一个空项目

http://10.15.4.11:7979/houtai/test.git

第三步,push项目到目标服务器新建项目

  1. // 进入项目目录
  2. cd test.git
  3. // 推送到目标服务器
  4. git push --mirror http://10.15.4.11:7979/houtai/test.git

结束

注:原项目使用方式只需切换远程地址

  1. git remote set-url origin http://10.15.4.11:7979/houtai/test.git
  2. // 查看地址是否切换成功
  3. git remote -v

升级可能用到的命令

  1. # 备份文档
  2. gitlab-rake gitlab:backup:create
  3. # 还原命令 到版本号就行
  4. gitlab-rake gitlab:backup:restore BACKUP=1685357636_2023_05_29_11.3.0
  5. # gitLab 升级不能跨版本,需要先升级到指定版本才可以继续升级
  6. # 升级顺序参考官网地址:
  7. # https://docs.gitlab.com/ee/update/index.html#upgrade-paths
  8. # 或
  9. # https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/?current=11.3.14&target=15.11.6&distro=docker&edition=ce
  10. # docker 安装
  11. # 拉取指定版本,例如15.4.6版本
  12. docker pull gitlab/gitlab-ce:15.4.6-ce.0 &
  13. # 安装
  14. sudo docker run --detach \
  15. --publish 443:443 --publish 80:80 --publish 8222:22 \
  16. --name gitlabs \
  17. --restart always \
  18. --volume /home/gitlabs/config:/etc/gitlab:Z \
  19. --volume /home/gitlabs/logs:/var/log/gitlab:Z \
  20. --volume /home/gitlabs/data:/var/opt/gitlab:Z \
  21. gitlab/gitlab-ce:15.4.6-ce.0
  22. # 安装时会执行:gitlab-ctl reconfigure, 该命令会升级仓库信息
  23. # 版本13 升级 版本14容易失败,最好每次升级成功后都先备份下
  24. # rpm 安装
  25. # 以centos7安装版本13.12.15为例
  26. wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm/download.rpm
  27. rpm -ivh gitlab-ce-15.11.6-ce.0.el7.x86_64.rpm
  28. # 修改配置
  29. vi /etc/gitlab/gitlab.rb
  30. gitlab-ctl reconfigure

gitliab下载地址

gitlab/gitlab-ce - Packages · packages.gitlab.com

 错误处理

1,错误提示:Whoops, something went wrong on our end

查询日志:tail -n 600 /var/log/gitlab/gitlab-rails/production.log

错误信息包含:OpenSSL::Cipher::CipherError ():

处理方法:

  1. # 进入db控制台
  2. sudo gitlab-rails dbconsole
  3. # 执行如下,清除token
  4. UPDATE projects SET runners_token = null, runners_token_encrypted = null;
  5. UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
  6. UPDATE application_settings SET runners_registration_token_encrypted = null;
  7. UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
  8. UPDATE ci_runners SET token = null, token_encrypted = null;

2,由备份文件还原仓库

1)解压备份文件,找到 仓库名.bundle文件

2)在gitlab私服创建新的仓库,记录新仓库地址

3)执行如下命令

  1. # 解压
  2. git clone 仓库名.bundle
  3. # 进入仓库
  4. cd 仓库名
  5. # 执行
  6. git remote rename origin old-origin
  7. git remote add origin 仓库地址
  8. git push -u origin --all
  9. git push -u origin --tags

注, 该还原方法会造成部分标签丢失

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/507874
推荐阅读
相关标签
  

闽ICP备14008679号