gitlab备份与恢复
一、gitlab备份
[root@localhost ~]# gitlab-rake gitlab:backup:create
Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... [DONE]
done
Dumping repositories ...
* newgroup/test ... [SKIPPED]
* newgroup/test.wiki ... [SKIPPED]
* zhangsan/zsproject ... [SKIPPED]
* zhangsan/zsproject.wiki ... [SKIPPED]
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: 1521890768_2018_03_24_10.6.0_gitlab_backup.tar ... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
Deleting old backups ... skipping
备份文件所在目录
[root@localhost ~]# ls /var/opt/gitlab/backups
1521890768_2018_03_24_10.6.0_gitlab_backup.tar
二、gitlab 恢复
需要停掉以下2个服务(停止数据的变更)
[root@localhost ~]# gitlab-ctl stop unicorn
ok: down: unicorn: 0s, normally up
[root@localhost ~]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
[root@localhost ~]# gitlab-rake backup:restore BACKUP=1521890768_2018_03_24_10.6.0
rake aborted!
Don't know how to build task 'backup:restore' (see --tasks)
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
启动服务 [root@localhost ~]# gitlab-ctl start
三、备份与还原过程中的权限问题
更多:https://jianshu.com/p/68a39c7193e7
mkdir /var/opt/gitlab/backups
chown git /var/opt/gitlab/backups
chmod 700 /var/opt/gitlab/backups
相关文章
- gitlab备份与恢复
一、gitlab备份 [root@localhost ~]# gitlab-rake gitlab:backup:create Dumping database ... Dumping Postgr
- rdb快照持久化
一、持久化的方式 什么是持久化:redis所有数据保存在内存中,对数据的更新将异步保存到磁盘上。 持久化:即把数据存储于断电后不会丢失的设备中,通常是硬盘。 常见的持久化方式:主从:通过从服务器保存
- 使用宝塔面板定时任务不执行问题处理
定时任务不执行 不用宝塔自带的计划任务,因为宝塔自带的计划任务无法以www:www身份去执行任务,会导致面板无法正常写入日志 在vps中输入:crontab -e -uwww ,然后贴上 * * *
- php配置加载器
配置加载器 当我们使用App::cfg系列方法获取配置时,wulaphp是通过配置加载器先加载配置然后再返回配置项对应值的(当然可以返回整个配置数组)。配置加载器ConfigurationLoade
- php手动编译fileinfo扩展
某些同学在执行php composer.phar install时,出现错误 90%可能是漏装了PHP的fileinfo扩展了,用宝塔的请直接在宝塔里安装 下载并解压PHP源码包(内含fileinfo
随机推荐
- gitlab备份与恢复
一、gitlab备份 [root@localhost ~]# gitlab-rake gitlab:backup:create Dumping database ... Dumping Postgr
- rdb快照持久化
一、持久化的方式 什么是持久化:redis所有数据保存在内存中,对数据的更新将异步保存到磁盘上。 持久化:即把数据存储于断电后不会丢失的设备中,通常是硬盘。 常见的持久化方式:主从:通过从服务器保存
- 使用宝塔面板定时任务不执行问题处理
定时任务不执行 不用宝塔自带的计划任务,因为宝塔自带的计划任务无法以www:www身份去执行任务,会导致面板无法正常写入日志 在vps中输入:crontab -e -uwww ,然后贴上 * * *
- php配置加载器
配置加载器 当我们使用App::cfg系列方法获取配置时,wulaphp是通过配置加载器先加载配置然后再返回配置项对应值的(当然可以返回整个配置数组)。配置加载器ConfigurationLoade
- php手动编译fileinfo扩展
某些同学在执行php composer.phar install时,出现错误 90%可能是漏装了PHP的fileinfo扩展了,用宝塔的请直接在宝塔里安装 下载并解压PHP源码包(内含fileinfo