3

I am trying to restore a backup from gitlab A into gitlab B. They are on the same version (8.15.0) but when I try to restore using this commands:

sudo gitlab-ctl stop sidekiq
sudo gitlab-ctl stop unicorn
sudo gitlab-rake gitlab:backup:restore BACKUP=1482434794_2016_12_22

I get the following error:

rake aborted!
TypeError: no implicit conversion of nil into String
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:122:in `exist?'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:122:in `unpack'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:32:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:backup:restore
(See full trace by running task with --trace)

The server have a clean install just with the root user created. Git lab is running and I already have run once:

sudo gitlab-ctl reconfigure

I am using ubuntu 16.04 LTS and installed Omnibus version. The command I use to make the backup is

sudo gitlab-rake gitlab:backup:create

And the generated file is like this:

1482434794_2016_12_22_gitlab_backup.tar

Any idea of what I'm doing wrong? Thanks for helping

Mario Corral
  • 387
  • 3
  • 13

2 Answers2

8

If you put only one backup in /var/opt/gitlab/backups/ you can use command sudo gitlab-rake gitlab: backup: restore without BACKUP = 1482434794_2016_12_22.

This helped in my case.

akaDemik
  • 104
  • 3
  • Thanks a lot. This fix it for me to. – Mario Corral Dec 23 '16 at 16:38
  • This isn't really a fix, considering that this just forces a default. Has anyone found a way to specify a backup and made it work with a specific stamp? – abegosum Dec 23 '16 at 21:29
  • I had the exact same issue, also on Ubuntu 16.04, importing a backup from Ubuntu 14.04. Skipping the BACKUP parameter made it work. – Sergiu Dec 24 '16 at 12:33
  • 1
    @abegosum Yes, this is a workaround. Actual state of fix can be tracked in [Gitlab issue #26090](https://gitlab.com/gitlab-org/gitlab-ce/issues/26090) – akaDemik Dec 27 '16 at 11:35
2

This might help others reading this post, I was able to restore my backup by specifying the full backup file name (not just the timestamp)

I am using gitlab-ce 8.15.4-ce.1 (omnibus installation) with Ubuntu 16.04

sudo gitlab-rake gitlab:backup:restore BACKUP=1484655963_2017_01_17_gitlab_backup.tar
sys0dm1n
  • 819
  • 6
  • 13