Skip to main content

Recover GitLab from filesystem backup

Install new instance/node before proceeding 

Install gitlab on server and move postgres DB as backup (Steps bellow for ubuntu)

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
apt-get install gitlab-ce
gitlab-ctl reconfigure
mv /var/opt/gitlab/postgresql/data /root/
gitlab-ctl stop

Transfer backup

rsync -vaopHDS --stats --ignore-existing -P /backup/old-git.server.com/var/opt/gitlab/postgresql/* root@new-git.server.com:/var/opt/gitlab/postgresql && rsync -vaopHDS --stats --ignore-existing -P /backup/old-git.server.com/etc/gitlab/gitlab.rb root@new-git.server.com:/etc/gitlab/gitlab.rb  && rsync -vaopHDS --stats --ignore-existing -P /backup/old-git.server.com/var/opt/gitlab/git-data/repositories/* root@new-git.server.com:/var/opt/gitlab/git-data/repositories

Restart/reconfigure gitlab services

gitlab-ctl upgrade
gitlab-ctl reconfigure
gitlab-ctl restart