Default location of backups is /var/opt/gitlab/backups.

docker exec -t <name of container> gitlab-rake gitlab:backup:create

Get your backup.

docker cp <name of container>:/var/opt/gitlab/backups/<name of backup> .

Also backup your secrets.

docker cp <name of container>:/etc/gitlab/gitlab-secrets.json .


The backup tarball has to be available in the backup location (default location is /var/opt/gitlab/backups).

docker cp <name of backup> <name of container>:/var/opt/gitlab/backups

The git user has to be owner of the tarball.

 docker exec -it <name of container> chown git:git /var/opt/gitlab/backups/<name of backup>

Run the restore task.

docker exec -it <name of container> gitlab-rake gitlab:backup:restore

Next, restore /etc/gitlab/gitlab-secrets.json.

docker cp gitlab-secrets.json <name of pod>:/etc/gitlab/gitlab-secrets.json

Source: gitlab docs