% docker exec -it gitlab gitlab-backup restore Unpacking backup ... done Before restoring the database, we will remove all existing tables to avoid future upgrade problems. Be aware that if you have custom tables in the GitLab database these tables and all data will be removed.
Do you want to continue (yes/no)? yes
2020-06-04 01:59:16 +0000 -- done 2020-06-04 01:59:16 +0000 -- Restoring repositories ... * devsawd/hello-world ... [DONE] 2020-06-04 01:59:16 +0000 -- done 2020-06-04 01:59:16 +0000 -- Restoring uploads ... 2020-06-04 01:59:17 +0000 -- done 2020-06-04 01:59:17 +0000 -- Restoring builds ... 2020-06-04 01:59:17 +0000 -- done 2020-06-04 01:59:17 +0000 -- Restoring artifacts ... 2020-06-04 01:59:17 +0000 -- done 2020-06-04 01:59:17 +0000 -- Restoring pages ... 2020-06-04 01:59:17 +0000 -- done 2020-06-04 01:59:17 +0000 -- Restoring lfs objects ... 2020-06-04 01:59:17 +0000 -- done This task will now rebuild the authorized_keys file. You will lose any data stored in the authorized_keys file. Do you want to continue (yes/no)? yes
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data and are not included in this backup. You will need to restore these files manually. Restore task is done.
devsawd/hello-world 프로젝트도 복구되었다는 로그가 보입니다.
로그인 후 확인
root, devsawd 계정도 잘 살아있고 프로젝트도 정상적으로 복구되었습니다!
마무리
명령어 몇번과 tar 복구파일 하나만으로 GitLab의 데이터들을 복구할 수 있었습니다. 일정 기간을 가지고 스냅샷을 찍듯 데이터를 백업하는 방법도 있는데… ~ 언제 하지? ~