实际应用
设置之前要在个人用户设置中增加key(为了备份ssh的项目)
备份
进入ditlab容器
cd /home/git/gitlab
bundle exec rake gitlab:backup:create RAILS_ENV=production
 
cd /home/git/gitlab
bundle exec bin/rake gitlab:backup:restore RAILS_ENV=production 
chown git:git -R /opt/gitlab-7.11.4-0/apps/gitlab/repositories
 
 以上为自我时间内容,以下为转载其他人内容

分类: 项目管理

   
   下载安装包wget https://downloads.bitnami.com/files/stacks/gitlab/7.11.4-0/bitnami-gitlab-7.11.4-0-linux-x64-installer.run
   然后更改成执行权限:chmod a+x bitnami-gitlab-7.11.4-0-linux-x64-installer.run
   再执行安装:./bitnami-gitlab-7.11.4-0-linux-x64-installer.run
   按照提示安装输入Y/N安装:

点击(此处)折叠或打开

  1. [root@wb-2 ~]# ./bitnami-gitlab-7.11.4-0-linux-x64-installer.run
  2. The installer detects that exists a 'git' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y
  3. The installer detects that exists a 'gitlab_ci' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y
  4. ----------------------------------------------------------------------------
  5. Welcome to the Bitnami Gitlab Stack Setup Wizard.
  6. ----------------------------------------------------------------------------
  7. Select the components you want to install; clear the components you do not want
  8. to install. Click Next when you are ready to continue.
  9. PhpPgAdmin [Y/n] :Y
  10. GitLab : Y (Cannot be edited)
  11. GitLab CI [Y/n] :Y
  12. Is the selection above correct? [Y/n]: Y
  13. ----------------------------------------------------------------------------
  14. Installation folder
  15. Please, choose a folder to install Bitnami Gitlab Stack
  16. Select a folder [/opt/gitlab-7.11.4-0]: /opt/bitnami
  17. ----------------------------------------------------------------------------
  18. Create Admin account
  19. Bitnami Gitlab Stack admin user creation
  20. Email Address [user@example.com]: test@gmail.com
  21. Login [user]: test
  22. Password :
  23. Please confirm your password :
  24. ----------------------------------------------------------------------------
  25. Hostname that will be used to create internal URLs. If this value is incorrect,
  26. you may be unable to access your Gitlab installation from other computers. It is
  27. advisable to use a Domain instead of an IP address for compatibility with
  28. different browsers.
  29. Domain [127.0.0.1]: test.gitlab.com
  30. Do you want to configure mail support? [y/N]: N
  31. ----------------------------------------------------------------------------
  32. Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.
  33. Do you want to continue? [Y/n]: Y
  34. ----------------------------------------------------------------------------
  35. Please wait while Setup installs Bitnami Gitlab Stack on your computer.
  36. Installing
  37. 0% ______________ 50% ______________ 100%
  38. #########################################
  39. ----------------------------------------------------------------------------
  40. Setup has finished installing Bitnami Gitlab Stack on your computer.
  41. Info: To access the Bitnami Gitlab Stack, go to
  42. http://dev.domain.org:80 from your browser.
  43. Press [Enter] to continue:

上面红色标志的按照自己喜好设置了,如安装路径、admin用户等。
      到此,整个安装结束,设置好HOST后访问test.gitlab.com就可以正常使用了。

备份以及恢复的操作,以下操作使用root用户执行:

      1、指定备份路径vi /opt/gitlab-6.4.3-1/apps/gitlab/htdocs/config/gitlab.yml,找到如下所示修改

点击(此处)折叠或打开

  1. ## Backup settings
  2. backup:
  3. path: "/tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)

2、执行备份

点击(此处)折叠或打开

  1. cd /opt/gitlab-7.11.4-0/
  2. ./use_gitlab
  3. cd /opt/gitlab-7.11.4-0/apps/gitlab/htdocs
  4. bundle exec bin/rake gitlab:backup:create RAILS_ENV=production

操作执行完毕,会在/tmp/backups/目录下生产一个备份文件,类似1438917368_gitlab_backup.tar

3、恢复备份的数据

点击(此处)折叠或打开

  1. cd /opt/gitlab-7.11.4-0/
  2. ./use_gitlab
  3. cd /opt/gitlab-7.11.4-0/apps/gitlab/htdocs
  4. bundle exec bin/rake gitlab:backup:restore RAILS_ENV=production
  5. chown git:git -R /opt/gitlab-7.11.4-0/apps/gitlab/repositories

如果备份的目录下不止一个备份文件,则RAILS_ENV=production后面需要指定备份文件 BACKUP=xxx。
       至此备份恢复完毕。

git 备份和恢复的更多相关文章

  1. MySQL没有备份怎么恢复被drop的表(利用undrop-for-innodb)

    介绍:     也许大家都难以理解,这么重要的数据为啥不备份(或者备份不可用)?而且还任性的drop table了.显然有备份是最好的,但是它们并不总是可用的.这种情况令人恐惧,但并非毫无希望.在许多 ...

  2. GIT仓库如何恢复到前一次提交

    GIT仓库如何恢复到前一次提交   通过使用Git版本恢复命令reset,可以回退版本.reset命令有3种方式: git reset –mixed:此为默认方式,不带任何参数的git reset,即 ...

  3. Gitlab备份和恢复操作记录

    前面已经介绍了Gitlab环境部署记录,这里简单说下Gitlab的备份和恢复操作记录: 1)Gitlab的备份目录路径设置 [root@code-server ~]# vim /etc/gitlab/ ...

  4. 转载:Gitlab备份和恢复操作记录

    转载:Gitlab备份和恢复操作记录 包含了备份和数据恢复的操作记录,实验可行 前面已经介绍了Gitlab环境部署记录,这里简单说下Gitlab的备份和恢复操作记录: 1)Gitlab的备份目录路径设 ...

  5. Gitlab+Jenkins学习之路(四)之gitlab备份和恢复

    gitlab的备份和恢复 (1)创建备份目录,并授权 [root@linux-node1 ~]# mkdir /data/backups/gitlab -p [root@linux-node1 ~]# ...

  6. Git 将代码恢复到一个历史的版本

    Git 将代码恢复到一个历史的版本 要把代码回到某个历史版本 比如 test有两种方法 暴力的方式 如果你的仓库是自己在用(不影响别人),那么你可以使用 git reset --hard <ta ...

  7. 【linux】【gitlab】gitlab安装、备份、恢复、升级、内存消耗问题

    前言 GitLab:GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务.功能:Gitlab 是一个提供代码托管.提交审核和问题跟踪的代码管理平 ...

  8. Python进阶----pymysql的安装与使用,mysql数据库的备份和恢复,mysql的事务和锁

    Python进阶----pymysql的安装与使用,mysql数据库的备份和恢复,mysql的事务和锁 一丶安装 pip install PyMySQL 二丶pymysql连接数据库 ### 语法: ...

  9. 我的MYSQL学习心得(十四) 备份和恢复

    我的MYSQL学习心得(十四) 备份和恢复 我的MYSQL学习心得(一) 简单语法 我的MYSQL学习心得(二) 数据类型宽度 我的MYSQL学习心得(三) 查看字段长度 我的MYSQL学习心得(四) ...

随机推荐

  1. 跟我一起写Makefile:MakeFile介绍

    makefile 介绍 make命令执行时,需要一个 makefile 文件,以告诉make命令如何去编译和链接程序. 首先,我们用一个示例来说明makefile的书写规则.以便给大家一个感性认识.这 ...

  2. C# Adomd Connection Analysis Service View Cube

    首先需要先引用 C:\Program Files\Microsoft.NET\ADOMD.NET\100\Microsoft.AnalysisServices.AdomdClient.dll      ...

  3. iOS Xcode8的适配

    1.打开应用后打印了很多的log信息 解决方法: Xcode8里边 Edit Scheme... -> Run -> Arguments, 在Environment Variables里边 ...

  4. HTML5 Canvas动画效果演示

    HTML5 Canvas动画效果演示 主要思想: 首先要准备一张有连续帧的图片,然后利用HTML5 Canvas的draw方法在不同的时间 间隔绘制不同的帧,这样看起来就像动画在播放. 关键技术点: ...

  5. JAVA中List转换String,String转换List,Map转换String,String转换Map之间的转换类

    <pre name="code" class="java"></pre><pre name="code" cl ...

  6. C# WPF 解压缩7zip文件 带进度条 sevenzipsharp

      vs2013附件 :http://download.csdn.net/detail/u012663700/7427461 C# WPF 解压缩7zip文件 带进度条 sevenzipsharp W ...

  7. UVA 10714 Ants 蚂蚁 贪心+模拟 水题

    题意:蚂蚁在木棍上爬,速度1cm/s,给出木棍长度和每只蚂蚁的位置,问蚂蚁全部下木棍的最长时间和最短时间. 模拟一下,发现其实灰常水的贪心... 不能直接求最大和最小的= =.只要求出每只蚂蚁都走长路 ...

  8. [Whole Web, Nods.js, PM2] Passing environment variables to node.js using pm2

    learn how to pass environment variables to your node.js app using the pm2 config file. This is usefu ...

  9. android93 进程优先级补充

    ###进程优先级(一个应用可以有多个进程,比如有Activity的进程和service的进程,)* 五种前台进程 * 拥有一个正在与用户交互的activity(onResume调用)的进程 * 拥有一 ...

  10. bash shell for循环1到100 .

    前言 用bash shell写程序时,经常会用到for循环,特别是从1到100这种需求,这里记录几种shell中从1到100的循环方法   方法 类c语言 for ((i=1; i<=100;  ...