Gitlab 备份迁移恢复报错gtar: .: Cannot mkdir: No such file or directory

网友投稿 1270 2022-10-05

Gitlab 备份迁移恢复报错gtar: .: Cannot mkdir: No such file or directory

Gitlab 备份迁移恢复报错gtar: .: Cannot mkdir: No such file or directory

1. 版本信息

OS: centos 6.9 Gitlab: gitlab-ce.10.7.4 gitlab-ce.10.8.0 gitlab-ce.10.8.3 gitlab-ce.10.8.4

2. 数据备份

//segmentfault.com/a/1190000014729115 参考以上url 即可完成数据备份。

3. Gitlab数据还原

//segmentfault.com/a/1190000014729115 参考以上url 即可完成数据备份还原。

4.Gitlab数据还原失败

原因:gitlab版本restore存在bug,目录权限问题导致还原失败。issue:1528963129_2018_06_14_10.8.4_gitlab_backup.tar 192.168.99.115:`pwd`#chown git.git /var/opt/gitlab/backups/*.targitlab-ctl stop unicorngitlab-ctl stop sidekiqgitlab-rake gitlab:backup:restore**错误提示:**[DONE]doneRestoring uploads ...tar: .: Cannot mkdir: No such file or directorytar: Exiting with failure status due to previous errorsBackup failed各位看官,看到该提示是不是超蛋疼,大脑飘过十万个草泥马!别急,能解决的,咱可以手动;

5. Gitlab的备份过程

Dumping database ... Dumping PostgreSQL database gitlab hq_production ... [DONE]doneDumping repositories ... * arch/k-calc ... [DONE] * arch/sms ... [DONE] * doneDumping uploads ... doneDumping builds ... doneDumping artifacts ... doneDumping pages ... doneDumping lfs objects ... doneDumping container registry images ... [DISABLED]Creating backup archive: 1528963129_2018_06_14_10.8.4_gitlab_backup.tar ... doneUploading backup archive to remote storage ... skippedDeleting tmp directories ... donedonedonedonedone其实就是使用tar打包过程,db 和 repositories 除外!! 各位看官,说到这里是不是想起来点什么,继续往下看哦 !!!

6.数据还原过程

Unpacking backup ... doneBefore restoring the database, we will remove all existingtables to avoid future upgrade problems. Be aware that if you havecustom tables in the GitLab database these tables and all data will beremoved.Do you want to continue (yes/no)? yesRemoving all tables. Press `Ctrl-C` within 5 seconds to abortCleaning the database ... doneRestoring database ... Restoring PostgreSQL database gitlabhq_production ... SETSETSET set_config GRANT[DONE]doneRestoring repositories ... * arch/k-calc ... [DONE] * arch/sms ... [DONE]Put GitLab hooks in repositories dirs [DONE]doneRestoring uploads ... ....

7.解决数据还原

#cd /var/opt/gitlab/backups#ls 1528963129_2018_06_14_10.8.4_gitlab_backup.tar backup_information.yml db pages.tar.gz tmp artifacts.tar.gz builds.tar.gz lfs.tar.gz repositories uploads.tar.gzrestore handy:#tar xf uploads.tar.gz -C /var/opt/gitlab/gitlab-rails/uploads#tar xf builds.tar.gz -C /var/opt/gitlab/gitlab-ci/builds#tar xf pages.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/pages#tar xf artifacts.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/artifacts***************************以下是我自己搭建的gitlab(版本号:11.6.5)上遇到问题*********************************但是检查以上4个目录,和原版本没有区别,已经恢复成功了,但是报错(难道这又是官方bug),既然已经成功恢复了,那就先不管了看到这里是不是欣喜若狂,毕竟Gitlab是基础服务,程序员的结晶之地啊!!!注意: db、repositories 的数据已经还原,了解本质过程很重要的,万物皆有相克!!!如果数据还原没有提到的,请自行脑补啊,不在多做累述!!!以下命令对还原数据可靠性检测#gitlab-ctl reconfigure#gitlab-ctl restart#gitlab-rake gitlab:check SANITIZE=true

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:猜画小歌:人工智能AI猜你画的是什么(猜画小歌属于微信小程序AI应用吗)
下一篇:shell 版本号比较_用shell如何比较软件版本号的大小
相关文章

 发表评论

暂时没有评论,来抢沙发吧~