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的更多相关文章

  1. node 报错 env: node\r: No such file or directory

    最近在编写一个命令行工具.使用 npm link 时可以正常运行.但是 ctrl+s 保存后, 再运行则报错 env: node\r: No such file or directory ,需要再 n ...

  2. 使用nsenter进入docker容器后端报错 mesg: ttyname failed: No such file or directory

    通过nsenter 进入到docker容器的后端总是报下面的错,, [root@devdtt ~]# docker inspect -f {{.State.Pid}} mynginx411950 [r ...

  3. 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 ...

  4. 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 ...

  5. 安装apr-1.6.3报错[cannot remove `libtoolT’: No such file or directory]解决方法

    发现有这个提示:cannot remove `libtoolT’: No such file or directory , 编辑 configure文件,查找 $RM "$cfgfile&q ...

  6. 报错:Error: ENOENT, no such file or directory 'c:\Users\Administrator\WebstormProjects\blogtest\views\footer.ejs'

    这是我在index上引用<%- include footer %>,找不到该文件 所以报错 建立文件footer.ejs

  7. Linux安装redis报错:jemalloc/jemalloc.h: No such file or directory踩坑

    报错内容: 针对这个错误,我们可以在README.md 文件中看到解释: --------- Selecting a non-default memory allocator when buildin ...

  8. createNewFile() 报错 open failed: ENOENT (No such file or directory) 的解决方案

    在写Android应用中使用createNewFile() 遇到open failed: ENOENT (No such file or directory) 错误,在网上查了许多方法,不过都不能解决 ...

  9. PHP连接MySQL的时候报错SQLSTATE[HY000] [2002] No such file or directory

    错误环境:Mac OS 10.10 找到mysql.sock文件的位置 $sudo find / -name mysql.sock ------结果如下---------- find: /dev/fd ...

随机推荐

  1. spring集成Hessian的基本使用方法

    一.什么是RPC RPC全称Remote Procedure Call,中文名叫远程过程调用.RPC是一种远程调用技术,用于不同系统之间的远程相互调用.其在分布式系统中应用十分广泛. 二.什么是Hes ...

  2. 11:12:21.924 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.

    11:12:21.924 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class or ...

  3. Spring Boot笔记六:Thymeleaf介绍

    目录 什么是thymeleaf? 创建最简单的thymeleaf thymeleaf语法 什么是thymeleaf? thymeleaf是一个模板引擎,是用来在Spring Boot中代替JSP的 引 ...

  4. python 管道 事件(Event) 信号量 进程池(map/同步/异步)回调函数

    ####################总结######################## 管道:是进程间通信的第二种方式,但是不推荐使用,因为管道会导致数据不安全的情况出现 事件:当我运行主进程的 ...

  5. 4.Zuul-限流

    令牌桶 限流流程图: RateLimitFilter : package com.wangfajun.filter; import com.alibaba.fastjson.JSON; import ...

  6. Web API中的返回值类型

    WebApi中的返回值类型大致可分为四种: Void/ IHttpActionResult/ HttpResponseMessage /自定义类型 一.Void void申明方法没有返回值,执行成功后 ...

  7. 学习总结:CSS(一)定义方式、选择器、选择器权重

    一.CSS的定义方式 1.内部样式:<style></style> 2.行间样式:<div style="width:100px;height:100px;&q ...

  8. Spark RDD基本概念与基本用法

    1. 什么是RDD RDD(Resilient Distributed Dataset)叫做分布式数据集,是Spark中最基本的数据抽象,它代表一个不可变.可分区.里面的元素可并行计算的集合.RDD具 ...

  9. tomcat优化之安装并配置apr库

    在谈到tomcat优化时,必然要说到apr库,这个库是C语言实现的,tomcat通过JNI方式使用该库可以大大提高性能. tomcat在使用apr时需要安装apr,apr-util和tomcat-na ...

  10. 【八】虚拟机工具 01 jps命令详解

    JPS 名称: jps - Java Virtual Machine Process Status Tool 命令用法: jps [options] [hostid] options:命令选项,用来对 ...