본문 바로가기
버전관리/GitLab

GitLab 버전 업데이트(2) - 백업

by 주리니e 2022. 7. 11.
728x90

GitLab 버전 업데이트(2) - 백업

 

우선 현재 GitLab을 백업하자.
나는 gitlab containner 생성 시 docker-compose.yml 설정파일에 다음과 같이 백업 설정을 하였다.

version: '3'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:13.12.15-ce.0'
    restart: always
    hostname: 'gitlab.com'
    container_name: gitlab
    privileged: true
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.nips.local'
        gitlab_rails['smtp_enable'] = true
        gitlab_rails['smtp_address'] = 'mail.gitlab.kr'
        gitlab_rails['smtp_port'] = 25
        gitlab_rails['smtp_domain'] = 'mail.gitlab.kr'
        gitlab_rails['smtp_enable_starttls_auto'] = true
        gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
        gitlab_rails['gitlab_email_from'] = 'gitlab@gitlab.com'
        gitlab_rails['time_zone'] = 'Asia/Seoul'
        nginx['redirect_http_to_https'] = true
    #network_mode: bridge
    networks:
      vpcbr:
        ipv4_address: 172.18.0.2
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - '/data/gitlab/config:/etc/gitlab'
      - '/data/gitlab/logs:/var/log/gitlab'
      - '/data/gitlab/data:/var/opt/gitlab'
      - '/home/gitlab/backups:/var/opt/gitlab/backups'
networks:
  vpcbr:
    driver: bridge
    ipam:
     config:
       - subnet: 172.18.0.0/16

 

  • GitLab 12.2 or later :
$ docker exec -t <container name> gitlab-backup create

 

  • Example...
2022-07-11 06:22:49 +0000 -- Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2022-07-11 06:22:54 +0000 -- done
2022-07-11 06:22:54 +0000 -- Dumping repositories ...
 * web/test-repo (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce) ... 
 * web/test-repo (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce) ... [DONE]
 * web/test-repo.wiki (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.wiki) ... 
 * web/test-repo.wiki (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.wiki) ... [EMPTY] [SKIPPED]
 * webtest-repo.design (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.design) ... 
 * web/test-repo.design (@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.design) ... [EMPTY] [SKIPPED]
 2022-07-11 06:24:16 +0000 -- done
2022-07-11 06:24:16 +0000 -- Dumping uploads ... 
2022-07-11 06:24:17 +0000 -- done
2022-07-11 06:24:17 +0000 -- Dumping builds ... 
2022-07-11 06:24:17 +0000 -- done
2022-07-11 06:24:17 +0000 -- Dumping artifacts ... 
2022-07-11 06:24:17 +0000 -- done
2022-07-11 06:24:17 +0000 -- Dumping pages ... 
2022-07-11 06:24:17 +0000 -- done
2022-07-11 06:24:17 +0000 -- Dumping lfs objects ... 
2022-07-11 06:24:17 +0000 -- done
2022-07-11 06:24:17 +0000 -- Dumping container registry images ... 
2022-07-11 06:24:17 +0000 -- done
Creating backup archive: 1657520657_2022_07_11_13.12.15_gitlab_backup.tar ... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
done
Deleting old backups ... skipping
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data 
and are not included in this backup. You will need these files to restore a backup.
Please back them up manually.
Backup task is done.

 

  • 경고메세지 : gitlab.rb,  gitalb-secrets.json은 수동으로 따로 백업해야 한다.
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data 
and are not included in this backup. You will need these files to restore a backup.
Please back them up manually.

 

  • 백업 파일
$ cd /home/gitlab/backups
$ ls
1657520657_2022_07_11_13.12.15_gitlab_backup.tar

 

보다 상세한 내용은 Gitlab 홈페이지 문서를 확인하자
https://docs.gitlab.com/ee/raketasks/backup_gitlab.html

 

Back up GitLab | GitLab

Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.

docs.gitlab.com

 

 

2022.07.06 - [버전관리/Gitlab] - Gitlab-CE 버전 업데이트(1) - 문서 확인

 

Gitlab-CE 13.12.15 to 15.1.1 업데이트 하기 (1)

Gitlab-CE 13.12.15 to 15.1.1 업데이트 하기 (1) https://about.gitlab.com/releases/2022/06/30/critical-security-release-gitlab-15-1-1-released/ GitLab Critical Security Release: 15.1.1, 15.0.4, and 14..

jiurinie.tistory.com

 

728x90

댓글