gitlab 迁移

场景:机房搬迁,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 包地址

posted @   zyl88  阅读(720)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
点击右上角即可分享
微信分享提示