1.恢复时 gitlab 版本应与备份时版本一致
2.默认卸载不完全,最好同时删除以下目录
# 同时删除备份目录,注意将备份文件保存至别处,/etc/gitlab/目录最好也备份下 rm -r /opt/gitlab/sv /opt/gitlab/service /opt/gitlab/init /opt/gitlab/etc /opt/gitlab/embedded/ssl/certs /opt/gitlab/embedded/service/gitlab-shell /opt/gitlab/embedded/service/gitlab-rails/public /opt/gitlab/embedded/service/gitlab-rails/config/initializers /opt/gitlab/embedded/cookbooks /var/opt/gitlab /opt/gitlab /etc/gitlab # 删除 systemd 启动文件,否则安装新版本后执行 gitlab-ctl reconfigure 会卡住 rm /usr/lib/systemd/system/gitlab-runsvdir.service
3. gitlab 恢复后如果进入项目 返回500错误,db_key_base 问题,将之前的 /etc/gitlab/gitlab-secrets.json 文件拿过来替换(最好备份时一同备份),然后执行 gitlab-ctl reconfigure