最近公司要把在云服务器的代码仓库迁移到内网
云服务器的gitlab是直接运行的,在内网要求使用docker部署,两边的版本都是gitlab ce 16.6.2
我在云服务器通过命令生成 了备份压缩包:
.gitlab-rake gitlab:backup:create
然后把压缩包下载到内网服务器,使用docker-compose运行gitlab
version: '3'
services:
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce:16.6.2-ce.0
restart: always
ports:
- "80:80"
environment:
- TZ=Asia/Shanghai
volumes:
- /data/gitlab/config:/etc/gitlab
- /data/gitlab/logs:/var/log/gitlab
- /data/gitlab/data:/var/opt/gitlab
networks:
- gitlab_network
networks:
gitlab_network:
driver: bridge
容器成功启动,并且可以正常访问
复制 gitlab-secrets.json gitlab.rb文件到/data/gitlab/config,重启容器生效
然后复制备份文件压缩包1706197160_2024_01_25_16.6.2_gitlab_backup.tar到/data/gitlab/data/backups
进入容器查看git用户的uid,之后给压缩包赋所有权到git用户
之后执行
gitlab-rake gitlab:backup:restore BACKUP=1706197160_2024_01_25_16.6.2
提示如下:
2024-01-26 11:58:25 UTC -- Unpacking backup ...
tar: Skipping to next header
tar: Skipping to next header
tar: Skipping to next header
tar: A lone zero block at 6596142
tar: Exiting with failure status due to previous errors
2024-01-26 11:58:29 UTC -- Unpacking backup failed
2024-01-26 11:58:29 UTC -- Deleting backup and restore PID file ... done
查看/data/gitlab/logs/gitlab-rails下面的backup_json.log:
{"severity":"INFO","time":"2024-01-26T11:58:25.470Z","correlation_id":null,"message":"Unpacking backup ... "}
{"severity":"INFO","time":"2024-01-26T11:58:29.994Z","correlation_id":null,"message":"Unpacking backup failed"}
我应该怎么解决这个问题?或者我从哪里可以获取详细的报错信息?请指点,感谢