Improve documentation about restore/backup process when using GitLab inside Docker (docker-compose)
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Hello,
I open this issue because I think an improvement of the documentation is needed in case of restore process when we use GitLab inside Docker.
I have multiple instance of GitLab: One GitLab-CE and one GitLab-EE
My question is :
- What is the correct process to restore an instance of GitLab-(ce/ee) when we use it inside docker ?
My instances are backup with this in crontab :
docker exec -t $(docker ps --filter name=gitlab --format '{{.Names}}') gitlab-rake gitlab:backup:create STRATEGY=copy CRON=1 SKIP=registry
docker exec -t $(docker ps --filter name=gitlab --format '{{.Names}}') /bin/sh -c 'umask 0077; tar cfz /secret/gitlab/backups/$(date "+\%Y_\%m_\%d_etc-gitlab-\%s.tgz") -C / etc/gitlab'
So in this documentation https://docs.gitlab.com/ce/raketasks/backup_restore.html#restore-prerequisites I found prerequisites that mention :
If you are restoring into directories that are mountpoints you will need to make sure these directories are empty before attempting a restore. Otherwise GitLab will attempt to move these directories before restoring the new data and this would cause an error
My second question is :
- which directories must be empty before the restoration process ? if it's the same answer as in my previous issue gitlab-ce#47035 what is the best command to clean these directories ? Why it's not describe in the official documentation ? because the prerequisites mention that:
we need to have a working GitLab installation before you can perform a restore
In my docker-compose file I have persisted all the data like this (I am using nfs via mount point) :
volumes:
- '/srv/git_nfs/gitlab/config:/etc/gitlab'
- '/srv/git_nfs/gitlab/logs:/var/log/gitlab'
- '/srv/git_nfs/gitlab/data:/var/opt/gitlab'
- '/srv/git_nfs/gitlab/secret:/secret/gitlab/backups'
so which directories must be emptied ?
Others questions :
- Should I stop completly the docker container
docker-compose downbefore performing the restore process ? - Should I stop GitLab to perform the restore process ? If Yes, with which command ?
- How to restore the configuration and secrets ?
Thank you very much for your help about this critical point about restore process
Best regards,