在 Debian 上“迁移 GitLab 仓库”通常有三种常见场景,我分别说明,你可以对号入座:
适用:把一台 Debian 上的 GitLab 完整搬到另一台 Debian
sudo gitlab-rake gitlab:backup:create
备份文件在:
/var/opt/gitlab/backups/
scp /var/opt/gitlab/backups/xxx_gitlab_backup.tar 新服务器:/var/opt/gitlab/backups/
sudo apt install gitlab-ee # 或 gitlab-ce
查看版本:
sudo gitlab-rake gitlab:env:info
sudo gitlab-ctl stop
sudo gitlab-rake gitlab:backup:restore BACKUP=时间戳
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
✅ 用户、仓库、CI、配置全部迁移
适用:换 GitLab 实例,只搬代码
git clone --mirror git@old-gitlab:group/repo.git
cd repo.git
git push --mirror git@new-gitlab:group/repo.git
GitLab 自带导入:
New project → Import project → GitHub / Gitee / URL
/etc/gitlab/gitlab.rb 需手动同步gitlab-ctl stop如果你能告诉我:
我可以直接给你一套“可执行命令清单”。