gitlab备份迁移与升级

升级计划:
    https://docs.gitlab.com/ee/update/index.html#upgrade-paths

  

1. 安装gitlab(和源版本必须保持一致) wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm 2. 以下都为默认配置:/etc/gitlab/gitlab.rb 备份文件存放位置: gitlab_rails['backup_path'] = "/var/opt/gitlab/backups" 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create 备份存储时间: gitlab_rails['backup_keep_time'] = 604800 迁移,恢复: scp 1630951224_2021_09_07_13.7.1_gitlab_backup.tar

scp /var/opt/gitlab/backups/1630951224_2021_09_07_13.7.1_gitlab_backup.tar root@192.168.0.237:/var/opt/gitlab/backups/


gitlab-ctl stop sidekiq  && gitlab-ctl stop unicorn
gitlab-rake gitlab:backup:restore BACKUP=/var/opt/gitlab/backups/1630951224_2021_09_07_13.7.1

gitlab-ctl start unicorn && gitlab-ctl start sidekiq
gitlab升级:
    升级包下载地址 https://packages.gitlab.com/gitlab/gitlab-ce/
    rpm -Uvh gitlab-ce-10.8.1-ce.0.el7.x86_64.rpm
    rpm -Uvh gitlab-ce-11.3.0-ce.0.el7.x86_64.rpm

    这里注意:升级版本有先后顺序,必须升级到10.8.1以后,才能继续升级到11.3.0,详情请看https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
    wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.8.8-ce.0.el7.x86_64.rpm/download.rpm
    rpm -Uvh gitlab-ce-13.8.8-ce.0.el7.x86_64.rpm
    查看版本:cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

  

 

posted @ 2021-11-22 10:50  MlxgzZ  阅读(39)  评论(0编辑  收藏  举报