Gitlab Data

Good Day, hope you can assist me … I have a new server DR and followed the this link for the install - Download and install GitLab | GitLab
Every step worked fine until I got to this step - Add the GitLab package repository and install the packages

Was getting issues trying to get to the site(Curl was failing) so as plan B I decided to get the Gitlab ce image from a different server via nexus and pull it onto my DR server and that worked. I managed to start the container and Gitlab via this command

Sudo podman run --detach
–hostname my hostaname
–publish 443:443 --publish 80:80 --publish 22:22
–name gitlab_ce
–restart always
–volume $GITLAB_HOME/config:/srv/gitlab
–volume $GITLAB_HOME/logs:/srv/log/gitlab
–volume $GITLAB_HOME/data:/srv/gitlab/data
–env GITLAB_CONFIG=“external_url ‘https://example.co.za/’;”
gitlab/gitlab-ce:latest

So far it seems all is working I’m able to enable features in side the gitlab.rb file etc, So we wanted to restore the data from backup , we backed our gitlab onto S3 and we mounted the backup on the new DR server and restored the data fine , extracted the data onto the directory as per the git-data inside the gitlab.rb path and restarted the container.

But we can’t seem to get all the repos across . I suspect permissions so i tried to run the chown git:git for the directory but I got invalid user , tried to run the rake command and that failed cause rake is not a valid command (might be because of the route we used to install gitlab image).

I cannot figure out what I did wrong not to get the repos, also the new project/group created in the new instance i get 'no repository ’ when i check the path.

Any ideas, assistance would be much appreciated.

Hi @Chiefshole

Have you used the gitlab-backup command to backup and restore? Here is the official guide.

If you are in disconnected environment you can download GitLab packages manually - gitlab-ce or gitlab-ee
Then you can run yum localinstall or maintain your own RPM repository in nexus and upload it there.

If using the official container image there are actually couple things you need to keep in mind.
For SELinux enabled servers, you have to specify z or Z in volume mounts. See here for details.
If you are not running podman as root you have to deal with user-namespaces and subuid/subgid.
You have actually defined env variable $GITLAB_HOME on your host.
All steps should be done from within the container itself. You can either do it from interactive shell podman exec -ti gitlab_ce /bin/bash or commands like podman exec gitlab_ce chown -R git:git /srv/gitlab/data/git-data.

Any reason why you are not using the default paths for data, logs and config inside the container?

Hi @balonik
Have you used the gitlab-backup command to backup and restore? - We had backups on the old version and I don’t think they used gitlab-backup utility, we have a RHEL machine so we started on a clean slate but still will do the backups on the new version going forward.
So the plan is to copy the data across from S3 and mount the drive on our DR machine to pull through the data for testing… Reason for that is that users can reuse their data and not start from scratch…

So we wanted to follow the guide an install for Docker/Podman but we struggled getting the Curl command to work which would have brought the packages across so the next plan the was to get the image via nexus (was not happy with that) but we had to get the image and start the config.

I will use the podman exec gitlab_ce chown -R and test again (Thanks again for all the information)

I cannot remember why I stuck to SRV instead of VAR , no specific reason for that . Will that affect the config? or is it a preferences to use the defaults?

Hi @balonik , thanks for the support.

When i tried the backup restore I got the message below even though the .rb file is updated and the file is in the same path .
[root@server backups]# ls -la
total 106970980
drwxr-xr-x. 2 root root 42 Jun 22 08:17 .
drwxr-xr-x. 4 root root 41 Jun 22 12:09 …
-rw-------. 1 git git 109538283520 Jun 22 21:39 2021-03-19_gitlab_backup.tar

Error:
[root@server backups]# podman exec -it gitlab_ce gitlab-backup restore BACKUP=2021-03-19_gitlab_backup.tar
No backups found in /var/opt/gitlab/backups
Please make sure that file name ends with _gitlab_backup.tar
Error: non zero exit code: 1: OCI runtime error

I then saw on the restore page that the backup data has to be on the same version for it to work?
The current Gitlab is on version 11.4 and the upgrade is on 13.10 (I know there is a newer version already :smile: ) , But is there a way to still continue with the upgrade or Do we have to start all over again and create another clone of 11.4 > Upgrade that one to 12 then 13 and only then the restore will work?