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. 数据备份
https://segmentfault.com/a/1190000014729115
参考以上url 即可完成数据备份。
3. Gitlab数据还原
https://segmentfault.com/a/1190000014729115
参考以上url 即可完成数据备份还原。
4.Gitlab数据还原失败
原因:gitlab版本restore存在bug,目录权限问题导致还原失败。
issue:https://gitlab.com/gitlab-org/gitlab-ce/issues/46891
first:
#scp 1528963129_2018_06_14_10.8.4_gitlab_backup.tar 192.168.99.115:`pwd`
#chown git.git /var/opt/gitlab/backups/*.tar
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore
**错误提示:**
[DONE]
done
Restoring uploads ...
tar: .: Cannot mkdir: No such file or directory
tar: Exiting with failure status due to previous errors
Backup failed
各位看官,看到该提示是不是超蛋疼,大脑飘过十万个草泥马!别急,能解决的,咱可以手动;
5. Gitlab的备份过程
Dumping database ...
Dumping PostgreSQL database gitlab hq_production ... [DONE]
done
Dumping repositories ...
* arch/k-calc ... [DONE]
* arch/sms ... [DONE]
*
done
Dumping uploads ...
done
Dumping builds ...
done
Dumping artifacts ...
done
Dumping pages ...
done
Dumping lfs objects ...
done
Dumping container registry images ...
[DISABLED]
Creating backup archive: 1528963129_2018_06_14_10.8.4_gitlab_backup.tar
... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... done
done
done
done
done
其实就是使用tar打包过程,db 和 repositories 除外!!
各位看官,说到这里是不是想起来点什么,继续往下看哦 !!!
6.数据还原过程
Unpacking backup ... done
Before restoring the database, we will remove all existing
tables to avoid future upgrade problems. Be aware that if you have
custom tables in the GitLab database these tables and all data will be
removed.
Do you want to continue (yes/no)? yes
Removing all tables. Press `Ctrl-C` within 5 seconds to abort
Cleaning the database ...
done
Restoring database ...
Restoring PostgreSQL database gitlabhq_production ... SET
SET
SET
set_config
GRANT
[DONE]
done
Restoring repositories ...
* arch/k-calc ... [DONE]
* arch/sms ... [DONE]
Put GitLab hooks in repositories dirs [DONE]
done
Restoring 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.gz
restore 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
Gitlab 备份迁移恢复报错gtar: .: Cannot mkdir: No such file or directory的更多相关文章
- node 报错 env: node\r: No such file or directory
最近在编写一个命令行工具.使用 npm link 时可以正常运行.但是 ctrl+s 保存后, 再运行则报错 env: node\r: No such file or directory ,需要再 n ...
- 使用nsenter进入docker容器后端报错 mesg: ttyname failed: No such file or directory
通过nsenter 进入到docker容器的后端总是报下面的错,, [root@devdtt ~]# docker inspect -f {{.State.Pid}} mynginx411950 [r ...
- laravel 报错SQLSTATE[HY000] [2002] No such file or directory
在mac中执行php artisan migrate时报错 SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from i ...
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
分区的过程正常: [root@db1 /]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/tr ...
- 安装apr-1.6.3报错[cannot remove `libtoolT’: No such file or directory]解决方法
发现有这个提示:cannot remove `libtoolT’: No such file or directory , 编辑 configure文件,查找 $RM "$cfgfile&q ...
- 报错:Error: ENOENT, no such file or directory 'c:\Users\Administrator\WebstormProjects\blogtest\views\footer.ejs'
这是我在index上引用<%- include footer %>,找不到该文件 所以报错 建立文件footer.ejs
- Linux安装redis报错:jemalloc/jemalloc.h: No such file or directory踩坑
报错内容: 针对这个错误,我们可以在README.md 文件中看到解释: --------- Selecting a non-default memory allocator when buildin ...
- createNewFile() 报错 open failed: ENOENT (No such file or directory) 的解决方案
在写Android应用中使用createNewFile() 遇到open failed: ENOENT (No such file or directory) 错误,在网上查了许多方法,不过都不能解决 ...
- PHP连接MySQL的时候报错SQLSTATE[HY000] [2002] No such file or directory
错误环境:Mac OS 10.10 找到mysql.sock文件的位置 $sudo find / -name mysql.sock ------结果如下---------- find: /dev/fd ...
随机推荐
- u-boot(六)小结
目录 u-boot(六)小结 概述 内存分布 内核交互参数 title: u-boot(六)小结 tags: linux date: 2018-09-27 23:23:05 --- u-boot(六) ...
- falsk简单项目示例
目录结构: 源码及分析 https://github.com/freshman411/Flask_test/
- hbase 实战项目
首先 根据 hadoop 搭建 + hbase 搭建把 环境弄好 由于 hbase 依赖于 hdfs ,所以 需要 进入 hadoop -->sbin 下 启动 start-dfs.sh , s ...
- lucene相关
lucene相关: 应用领域: 互联网全文检索引擎(比如百度, 谷歌, 必应) 站内全文检索引擎(淘宝, 京东搜索功能) 优化数据库查询(因为数据库中使用like关键字是全表扫描也就是顺序扫描算法 ...
- 065、容器在Weave中如何通信和隔离?(2019-04-08 周一)
参考https://www.cnblogs.com/CloudMan6/p/7491831.html 在host2上执行如下命令: weave launch host1_ip 必须 ...
- parseDouble()方法
String a = "269"; double parseDouble = Double.parseDouble(b); System.out.println(“Double a ...
- Win10 64位连接LJM1005打印机局域网访问
除了网上常见的开Guest用户之类需要额外三个设置 (1)安装LJM1005驱动LJM1005_Full_Solution (2)设置打印机共享和安全中的everyone全部勾选(解决能看到打印机无法 ...
- Javaweb学习笔记——(十八)——————事务、DBCP、C3P0、装饰者模式
事务 什么是事务? 转账: 1.给张三账户减1000元 2.给李四账户加1000元 当给张三账户减1000元之后,抛出了异常,这 ...
- IL 学习笔记
先上几篇博客链接: 一步步教你读懂NET中IL(图文详解) C#基础之IL 详解.NET IL代码 C# IL DASM 使用 你必须知道的.NET <C# to IL>.<Expe ...
- web api HttpResponseMessage的简单使用
using Lemon.Common; using Lemon.WeChat.Model; using Lemon.WeChat.Services; using Newtonsoft.Json; us ...