gitlab-server的备份迁移

gitlab-server基于docker搭建,备份迁移命令组如下:

## 备份
### 12.2以后版本
docker exec -t <container name> gitlab-backup create
### 12.1以前版本
docker exec -t <container name> gitlab-rake gitlab:backup:create

在backups目录里面,有名为xxx_gitlab_backup.tar
的文件

## 恢复
### 12.2以后版本
# Stop the processes that are connected to the database
docker exec -it <name of container> gitlab-ctl stop unicorn
docker exec -it <name of container> gitlab-ctl stop puma
docker exec -it <name of container> gitlab-ctl stop sidekiq

# Verify that the processes are all down before continuing
docker exec -it <name of container> gitlab-ctl status

# Run the restore
 12.2以后版本
docker exec -it <name of container> gitlab-backup restore BACKUP=xxxx
 ## 注意,没有_gitlab_backup.tar部分

# Run the restore 12.1以前版本
docker exec -it gitlab-server gitlab-rake gitlab:backup:restore BACKUP=xxxx ## 注意,没有_gitlab_backup.tar部分

# Restart the GitLab container
docker restart <name of container>

# Check GitLab
docker exec -it <name of container> gitlab-rake gitlab:check SANITIZE=true

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注