How to migrate gitlab backups to new server which has latest gitlab version

会有一股神秘感。 提交于 2019-11-30 07:06:19

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.

According to the error message, the backup archive is created by (gitlab-6.5.1-0) and can't be restored using (gitlab 6.6.5-omnibus).

For simple solution, I'd recommend installing gitlab-6.5.1-omnibus and restored your backup archive first. Then, do the upgrade through linux package system. Run sudo gitlab-rake db:migrate if you encountered any problem related to databases

According to the Gitlab official documentation on Backing up and restoring GitLab:

You can only restore a backup to exactly the same version and type (CE/EE) of GitLab on which it was created. The best way to migrate your repositories from one server to another is through backup restore.

So, update your gitlab on OLD server first (i.e. 6.5.1-0 -> 6.6.5 ), then follow the official documentation will do.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!