'Recover Gitlab Docker setup

I am trying to recover a Gitlab backup. The setup was done using a Docker container. The used Gitlab version was gitlab-ce:10.7.3-ce.0. The backup I did regularly was from the folders:

  • /etc/gitlab/
  • /var/log/gitlab/
  • /var/opt/gitlab/

To run the Gitlab Docker container I used this BASH command:

sudo docker run --detach \
                --hostname gitlab.exampledomain.com \
                --publish 8081:80 \
                --name gitlab \
                --restart always \
                --volume /srv/gitlab/config:/etc/gitlab \
                --volume /srv/gitlab/logs:/var/log/gitlab \
                --volume /srv/gitlab/data:/var/opt/gitlab \
                gitlab/gitlab-ce:10.7.3-ce.0

To create the backup I used the following commands:

#!/bin/bash

# Turn off Gitlab.
sudo docker stop gitlab

# Backup Gitlab to tars.
sudo docker run --name temp-gitlab-backup-os \
                -it \
                -v /srv/gitlab/config:/etc/gitlab \
                -v /srv/gitlab/logs:/var/log/gitlab \
                -v /srv/gitlab/data:/var/opt/gitlab \
                -v $(pwd):/backup ubuntu:16.04 sh -c "tar -cvzf /backup/gitlab.tar.gz /etc/gitlab /var/log/gitlab /var/opt/gitlab"

# Delete temp container.
sudo docker rm temp-gitlab-backup-os

# Delete temp image.
sudo docker rmi ubuntu:16.04

# Turn on Gitlab.
sudo docker start gitlab

To import the backup to an empty Gitlab Docker container I used the following commands:

#!/bin/bash

# Turn off Gitlab.
sudo docker stop gitlab

# Import Gitlab backup.
sudo docker run --name temp-gitlab-backup-os \
                -it \
                -v /srv/gitlab/config:/etc/gitlab \
                -v /srv/gitlab/logs:/var/log/gitlab \
                -v /srv/gitlab/data:/var/opt/gitlab \
                -v $(pwd):/backup ubuntu:16.04 sh -c "tar -xvzf /backup/gitlab.tar.gz"

# Delete temp container.
sudo docker rm temp-gitlab-backup-os

# Delete temp image.
sudo docker rmi ubuntu:16.04

# Turn on Gitlab.
sudo docker start gitlab

Now, I would like to access the system again. So I create the Gitlab Docker container and then unzip the backup in the mentioned three folders. If I then run the Gitlab Docker container, it keeps on shutting down and restarting endlessly, preventing me from any access. I have all my projects on this Gitlab Docker backup, and I really want to regain access.

  • Is there any way I can find out the used Gitlab Docker container version from the mentioned backup folders to verify that it was run in fact with the version gitlab-ce:10.7.3-ce.0?
  • Is there any way I can access my projects in the mentioned backup folders? The data is there, but currently I have no idea how to export my projects.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source