Checkout all repositories at once. Requires your key to be set up in your account.

curl -sL 'https://gitlab.your.domain/api/v4/projects?per_page=100&private_token=XXXXXXXXXXXX' | jq '.[].ssh_url_to_repo' | xargs -l git clone


pip install gitlab jq

Edit file ~/.python-gitlab.cfg, specifying your own private token

default = company
ssl_verify = false
timeout = 5

url = https://gitlab.company.loc
# https://gitlab.company.loc/profile/personal_access_tokens
api_version = 4

Checkout all repo like before

for repo in $(gitlab -o json project list --all 2>/dev/null | jq '.[].ssh_url_to_repo' | egrep 'you_login|ansible|vagrant|packer' | tr -d '"'); do git clone $repo; done;


From manual installation to docker instance for exemple

Backup old instance

sudo gitlab-rake gitlab:backup:create

Get it from /opt/gitlab/backups/

Restore on new dockerized instance

Write down a docker-compose.yml file with something like the official example. Be careful to pick the same version as your existing installation, otherwise the procedure will fail. You can update Gitlab later on by replacing fixed version by latest.

Start it

docker-compose up -d

Copy downloaded backup where your dockerized Gitlab will use it

sudo cp gitlab_backup.tar ./gitlab/backups/migration_gitlab_backup.tar

Check container name

docker ps

Connect to docker, replacing gitlab_app_1 with your container name

sudo docker exec -ti  gitlab_app_1 bash

Make sure backup is owned by git

chown -R git:git /var/opt/gitlab/backups/

Stop services before restoration

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl status


gitlab-rake gitlab:backup:restore BACKUP=migration


gitlab-ctl start sidekiq
gitlab-ctl start unicorn
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true