如何将gitlab备份迁移到具有最新gitlab版本的新服务器 [英] How to migrate gitlab backups to new server which has latest gitlab version

查看:1457
本文介绍了如何将gitlab备份迁移到具有最新gitlab版本的新服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将旧服务器的gitlab备份迁移到新服务器。我的旧服务器有gitlab(gitlab-6.5.1-0),我的新服务器有gitlab版本(gitlab 6.6.5-omnibus)。使用以下命令从旧服务器备份数据:

$ p $ bundle exec rake gitlab:backup:create RAILS_ENV = production

当我尝试使用此命令在新服务器中恢复此备份时

  gitlab-rake gitlab:backup:restore BACKUP = 1395394855 

我得到以下输出:

 解包备份...完成
GitLab版本不匹配:
您当前的GitLab版本(6.6.5)与备份中的GitLab版本不同!
请切换到以下版本并重试:
版本:6f6f1588ba5123f156ee3b0635a061745b71fcde

我试图寻找解决方案。但是在所有文档中都说备份已经迁移到以前的版本。但他们都没有描述如何迁移备份。任何解决方案都是赞赏!

解决方案

此错误消息由 lib / backup / manager.rb#L87-L92


$ b

  settings = YAML.load_file(backup_information.yml)
ENV [VERSION] =#{settings [:db_version]}if settings [:db_version] .to_i> 0

#恢复不匹配的备份可能会导致意想不到的问题
如果设置[:gitlab_version]!= Gitlab :: VERSION
放置GitLab版本不匹配:red

它似乎强制进行增量备份,例如在此评论中描述


在将备份恢复到新服务器时,同样的问题。



backup.rake 检查GITLAB提交编号备份和当您恢复到最新检查出的同一分支名称。



我必须:


  • 删除 5-2-stable

  • 再次检出 5使用相同的提交散列( git checkout -b 5-2-stable COMMIT-HASH ),

  • 运行所有任务为安装新的 5-2-stable 版本同样的 config / gitlab.yml config / database.yml

  • 然后我将 backup.tar 文件复制到默认的 / home / git / gitlab / tmp / backups 并运行还原rake 任务。

  • / b>

    没有任何问题的工作。然后我遵循5-2稳定到5-3稳定的升级,并且进展顺利。



I am trying to migrate my gitlab backups for my old server to new server. my old server has gitlab (gitlab-6.5.1-0) and my new server has gitlab version (gitlab 6.6.5-omnibus). i taken backup from my old server using the following command

bundle exec rake gitlab:backup:create RAILS_ENV=production

and when i try to restore this backup in new server using this command

gitlab-rake gitlab:backup:restore BACKUP=1395394855

I am getting the following output

Unpacking backup ... done
GitLab version mismatch:
  Your current GitLab version (6.6.5) differs from the GitLab version in the backup!
  Please switch to the following version and try again:
  version: 6f6f1588ba5123f156ee3b0635a061745b71fcde

I tried searching for solution . but in all documents its says The backup is already migrated to the previous version. but none of them describes how to migrate backups . Any solution regarding this is Appreciated !

解决方案

This error message is produced by lib/backup/manager.rb#L87-L92:

  settings = YAML.load_file("backup_information.yml")
  ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0

  # restoring mismatching backups can lead to unexpected problems
  if settings[:gitlab_version] != Gitlab::VERSION
    puts "GitLab version mismatch:".red

It seems to force an incremental backup, as described in this comment:

I have faced the same issue when restoring the backup to a new server.

backup.rake checks GITLAB commit number at time of backup is taken and when you are restoring to the same branch name from latest check out.

I have to:

  • delete 5-2-stable and
  • check out again 5-2-stable with the same commit hash ( git checkout -b 5-2-stable COMMIT-HASH),
  • ran all tasks as installing a fresh 5-2-stable release with same config/gitlab.yml, config/database.yml.
  • Then I have copied backup.tar file into default /home/git/gitlab/tmp/backups and ran restore rake task.

It worked without any problem. Then I have followed 5-2-stable to 5-3-stable upgrade and it went all well.

这篇关于如何将gitlab备份迁移到具有最新gitlab版本的新服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆