littleboy
littleboy

Reputation: 11

Gitlab docker backup and restore

I am using GitLab via docker on an intranet disconnected from the internet. I run GitLab docker using docker-compose following yml file.

web:
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'myowngit.com'
    ports:
        - 8880:80
        - 8443:443
    volumes:
        - /srv/gitlab/config:/etc/gitlab
        - /srv/gitlab/logs:/var/log/gitlab
        - /srv/gitlab/data:/var/opt/gitlab

Then free space of 'volumes' is not enough so i move this path to '/mnt/mydata'. And I modify docker-compose.yml file.

... ... ...
    volumes:
        - /mnt/mydata/gitlab/config:/etc/gitlab
        - /mnt/mydata/gitlab/logs:/var/log/gitlab
        - /mnt/mydata/gitlab/data:/var/opt/gitlab

To start GitLab service run sudo docker-compose up -d. After running the GitLab service I try to explore the project repository but the repository is not found(HTTP response 404 or 503). What is the reason? How to move GitLab docker volume directory?

Upvotes: 1

Views: 1716

Answers (1)

VonC
VonC

Reputation: 1325986

It should work unless, as shown in docker-gitlab issue 562, to move was done with a different ownership

It should be okay to move the files from /data1/data to /data2/data, you should take a little care while copying the files to the new location. i.e. either of these should be fine

cp -a /data1/data /data2/data
rsync --progress -av /data1/data /data2/data

Simply doing cp -r /data1/data /data2/data will not preserve the ownership of the files which will cause issues.

Upvotes: 1

Related Questions