推送备份
推送备份到新的Harbor仓库
安装部署Harbor点击下方连接
推送数据
[root@localhost ~]# scp database.tar.gz registry.tar.gz root@192.168.1.12:~
关闭Harbor
我们首先需要关闭新创建的Harbor仓库,才能进行下一步
[root@localhost harbor]# docker-compose down
迁移
关闭之后,进入到之前挂载的目录中,然后删除日志以及仓库
[root@localhost ~]# cd /data/
[root@localhost data]# rm -rf database/ registry/
将旧数据的仓库以及日志拷贝到挂载目录下
[root@localhost data]# mv /root/database/ .
[root@localhost data]# mv /root/registry/ .
重新设置属主属组,之后启动Harbor**(这里不设置会报错)**
[root@localhost data]# chown -R polkitd.input database/
[root@localhost data]# cd /usr/local/harbor/
[root@localhost harbor]# docker-compose up -d
[+] Building 0.0s (0/0) docker:default
[+] Running 16/16
✔ Network harbor_harbor-notary Created 0.1s
✔ Network harbor_harbor-chartmuseum Created 0.1s
✔ Network harbor_notary-sig Created 0.0s
✔ Container harbor-log Started 0.0s
✔ Container harbor-db Started 0.0s
✔ Container registryctl Started 0.0s
✔ Container redis Started 0.0s
✔ Container harbor-portal Started 0.0s
✔ Container registry Started 0.0s
✔ Container chartmuseum Started 0.0s
✔ Container trivy-adapter Started 0.0s
✔ Container notary-signer Started 0.0s
✔ Container harbor-core Started 0.0s
✔ Container notary-server Started 0.0s
✔ Container nginx Started 0.0s
✔ Container harbor-jobservice Started
查看
此时我们看见旧仓库中的经行
此时我们也可以看见旧仓库中的日志