专业编程基础技术教程

网站首页 > 基础教程 正文

gitlab服务器迁移恢复

ccvgpt 2024-08-04 12:21:21 基础教程 19 ℃

安装方式:官网一件安装或者yum rpm方式

a原始服务器 b新服务器

gitlab服务器迁移恢复

1.备份原a服务器上的的数据

	gitlab-rake gitlab:backup:create RAILS_ENV=production

PS: 备份后的文件一般是位于/var/opt/gitlab/backups下, 自动生成文件名文件名如1530786828_2018_07_05_10.8.4-ee_gitlab_backup.tar

2.b新服务器安装和原来a服务器一样的gitlab版本,不然会失败

查看a服务器版本:

	gitlab-rake gitlab:env:info

安装历史版本去下载安装https://packages.gitlab.com/gitlab/

安装过程略

3. 将步骤1生成的tar文件拷贝到新b服务器上相应的backups目录下

	scp -pr 1530789100_2018_07_05_10.8.4-ee_gitlab_backup.tar root@119.23.8.80:/var/opt/gitlab/backups

4.设置b服务器备份文件的用户是git 权限是600,不然之后会报权限拒绝

	chown -R git.git /var/opt/gitlab/backups/

5.b执行恢复

	gitlab-rake gitlab:backup:restore RAILS_ENV=production BACKUP=1530789100_2018_07_05_10.8.4-ee

ps:这里没有后面的_gitlab_backup.tar名字

一路yes,但是注意恢复是会先删除新服务器b上所有数据

Tags:

最近发表
标签列表