场景:机房搬迁,gitlab迁移至腾讯云
解决:
1.在原服务器上使用命令生成备份包
gitlab-rake gitlab:backup:create 备份命令,会在目录/data/gitlab/backups下生成1579054425_2020_01_14_11.5.3_gitlab_backup.tar压缩包
gitlab-ctl stop 备份完成后关闭gitlab
2. 在腾讯云服务器上安装gitlab,注意安装的版本要和原服务器上的版本一致
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 查看gitlab版本
apt-get update
apt-get install -y curl openssh-server ca-certificates
echo "deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu bionic main" >> /etc/apt/source.list
apt-get update
apt-cache madison gitlab-ce
apt install gitlab-ce=12.6.4-ce.0
gitlab-ctl reconfigure 执行配置, 会在/data/下生成gitlab目录及子目录
将备份包上传到新服务器的/data/gitlab/backups下,scp /data/gitlab/backups/1638500617_2021_12_03_12.6.4_gitlab_backup.tar *******:/data/gitlab/backups
执行还原 :gitlab-rake gitlab:backup:restore BACKUP=1638500617_2021_12_03_12.6.4
gitlab-ctl start # 启动所有 gitlab 组件
gitlab-ctl stop # 停止所有 gitlab 组件
gitlab-ctl restart # 重启所有 gitlab 组件
gitlab-ctl status # 查看服务状态
gitlab-ctl reconfigure # 启动服务
gitlab-ctl show-config # 验证配置文件
gitlab-ctl tail # 查看日志
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件
参考 https://www.cnblogs.com/yangfan-123/p/11592905.html
https://www.cnblogs.com/ssgeek/p/9392104.html
https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=12.6.4 gitlab 包地址
标签:backup,gitlab,ce,12.6,ctl,迁移,data From: https://www.cnblogs.com/zyl88/p/16731778.html