Wondering about backup strategy with omnibus 8.5.1

Hi all,

I have just moved most of our stuff to a Gitlab instance, setup through omnibus. Very happy with what I see so far, but I am puzzled by how backups should be done:

Backups are taken with the documented rake command:

gitlab-rake gitlab:backup:create

then a bit more stuff for the /etc/gitlab folder, as documented here.

Problem comes from restore. The documentation specifically states:

You can only restore a backup to exactly the same version of GitLab that you created it on, for example 7.2.1.

Now my question is: if a server dies a year from now, I will get a new one and install Gitlab through omnibus. But obviously it will be Gitlab version 9 or 10. And I won’t be able to restore anything.

So how is this supposed to work? Do I have to download the omnibus 8.5.1, and each version of it that will be ever released, so I can reinstall the exact version of Gitlab needed to restore the backup I have when failure happens?

I could also tar and backup /var/opt/gitlab, but this has the postgres db data folder in it, redis, etc, I doubt just taking a tar and restoring that would provide a workable instance.

Any clue?

Rgds

Hi

Yes, you have to install Gitlab version matching your backup file. You can find out the version of your backup from backup_information.yml file present in the gitlab backup tar file. You can install the gitlab 8.5 and restore the existing backup on to it and upgrade from there.

Eg:
-rw-r--r-- 1 git git 60K Feb 19 12:50 1455866410_gitlab_backup.tar
[root@IndiaBnglr backups]# pwd
/var/opt/gitlab/backups
[root@IndiaBnglr backups]# cat backup_information.yml
:db_version: '20151228175719'
:backup_created_at: 2016-02-19 15:18:49.637189317 +05:30
:gitlab_version: 8.3.2
:tar_version: tar (GNU tar) 1.23
:skipped: repositories,uploads,builds,artifacts,lfs

You don’t need to download each and every version ever released after 8.5.5. You can upgrade directly to the version you wish to.
Incase of any failures/issues that could be because of the DB migrations between the versions, Upgrading in 1 or 2 hops (Eg: 8.5.5 to 8.9.0 and then 8.9.0 to 9.5.0 based on change log) will solve your problem.

Just backing up /var/opt/gitlab might not work as expected (need to be verified).

Hi

Thanks for your quick reply, but I am afraid things are not as clear cut as you seem to imply:

You can upgrade directly to the version you wish to.

I am talking about spinning up a new server, in case the old one died, was hacked, whatever. So the only thing I have is the backup files.

Upgrading in 1 or 2 hops (Eg: 8.5.5 to 8.9.0 and then 8.9.0 to 9.5.0 based on change log) will solve your problem.

How can I “upgrade in 2 hops”? Remember that I don’t have the previous installation. I have only a backup with the DB, config, etc.

That backup can only be restored to a, say 8.5.1, so I first need to install a 8.5.1 version of Gitlab, then restore, and then I can update to the current version.

So my question, again, is: can I have access to past versions of Gitlab omnibus, so that I can install and restore my backup?

Thanks and regards

Hi

Even if you install in a new server, if you have backup file in the below format

[root@IndiaBlr dailybackup]# ll
-rwx------ 1 git git 39989114880 Feb 26 07:21 1456449895_gitlab_backup.tar

You will be able to recover your previous setup, as it is. You need to do any extra configurations (eg: ldap etc) manually.

If you have a gitlab rake backup file (as shown above) taken using below command

sudo gitlab-rake gitlab:backup:create --trace

you can install 8.5.5 and restore that backup file on that installation and then upgrade to latest version. If upgrade fails in single try (if many versions are there in b/w) you can take two steps (two hops) and upgrade to latest version.

You can find Gitlab versions here:
Gitlab Latest Versions
Gitlab Archive Versions

Which is my question from the start: how do I install a Gitlab 8.5.1 a year from now?

I can only restore my backup to same version, so I need to have same version on the new server. How do I do that 1, 2 or 6 months after that version has been replaced with multiple new ones?

Rgds

Hi there. You can get past packages at https://about.gitlab.com/downloads/archives/

Hi

I have already answered this question in my previous reply. You need to download 8.5.1 from the below links and restore your backup on ur new server.

Check the below links


U can try this approach on a testing server and verify.