gitlab从8.4.4升级到11.1.4全过程
Host gitlab HostName 10.5.117.188 User root
因版跨度较大,无法直接升级到最新版本,采用曲线救国之路,从8->9->10->11
原来使用sameersbn部署 https://github.com/sameersbn/docker-gitlab
升级后改用官方推荐部署
原版本备份数据
docker-compose run --rm gitlab app:rake gitlab:backup:create
step1.初始版本 8.4.4
修改docker-compose.yml文件
postgresql需要9.6以上版本,以便后续数据导入
postgresql:
restart: always
image: sameersbn/postgresql:9.6-3
初始化启动
docker-compose up -d
拷贝备份数据到当前实例备份路径
cp backup.tar /path/to/backups/
暂停容器
docker-compose stop
导入数据
chmod 777 gitlab/gitlab/backups/1534959023_gitlab_backup.tar
docker-compose run --rm gitlab app:rake gitlab:backup:restore BACKUP=1534959023
step2.升级至9.5.5
修改docker-compose.yml文件
postgresql需要9.6以上版本
postgresql:
restart: always
image: sameersbn/postgresql:9.6-3
gitlab:
restart: always
image: sameersbn/gitlab:9.5.5
重复step1操作
step3.升级至10.6.4 ,以上
step4.升级至11.1.4 ,以上
升级完之后,需要导出最新版本数据,但此时报错 GRPC::Unavailable: 14:Connect Failed
参考 解决 https://github.com/sameersbn/docker-gitlab/issues/1655
GRPC::Unavailable: 14:Connect Failed
I'm having the same issue, follow the backup/restore guide in this project's README always throw the GRPC::Unavailable: 14:Connect Failed error(Gitlab version 11.0.1 and 11.0.3 both have this problem). After some research, I found a way to fix this.
The error is because of some service is not running when you're doing backup or restore, so to fix the problem, just make sure your gitlab is fully running when you are doing backup or restore.
For me, the procedure is:
Starting the gitlab container
Enter the gitlab's bash shell
Execute /sbin/entrypoint.sh app:rake gitlab:backup:restore to restore a backup
When restore finish, just restart gitlab container, and all is done.
For backup procedure, simply execute /sbin/entrypoint.sh app:rake gitlab:backup:create command when you're in gitlab container's shell.
进入容器备份数据
docker exec -it container_name bash sbin/entrypoint.sh app:rake gitlab:backup:create SKIP=registry
此时导出的数据在backups目录
step5.启用官方容器,导入基本新版本数据
docker-compose up -d
docker exec -it gitlab_gitlab_1 gitlab-rake gitlab:backup:create SKIP=registry
docker exec -it gitlab_gitlab_1 gitlab-rake gitlab:backup:restore BACKUP=1535004790_2018_08_23_11.1.4 SKIP=registry