Mais conteúdo relacionado
Semelhante a GitLabをバックアップしてみた (20)
Mais de VirtualTech Japan Inc./Begi.net Inc. (20)
GitLabをバックアップしてみた
- 3. バックアップのコマンド
• リポジトリその他のバックアップ
– $ sudo gitlab-backup create
– バックアップファイルは/var/opt/gitlab/backups
ディレクトリに作成されます
• 設定ファイルのバックアップ
– $ sudo gitlab-ctl backup-etc
– バックアップファイルは
/etc/gitlab/config_backupディレクトリに作成さ
れます
3
- 4. リポジトリその他のバックアップ例
$ sudo gitlab-backup create
2021-03-31 02:00:23 +0000 -- Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping repositories ...
* tmiyahar/test (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b) ... [DONE]
[SKIPPED] Wiki
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping uploads ...
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping builds ...
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping artifacts ...
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping pages ...
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping lfs objects ...
2021-03-31 02:00:24 +0000 -- done
2021-03-31 02:00:24 +0000 -- Dumping container registry images ...
2021-03-31 02:00:24 +0000 -- [DISABLED]
Creating backup archive: 1617156024_2021_03_31_12.5.0-ee_gitlab_backup.tar ... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... 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.
4
- 5. 設定ファイルのバックアップ例
• $ sudo gitlab-ctl backup-etc
• Could not find '/etc/gitlab/config_backup' directory. Creating.
• Running configuration backup
• Creating configuration backup archive:
gitlab_config_1617158184_2021_03_31.tar
• /etc/gitlab/
• /etc/gitlab/gitlab.rb
• /etc/gitlab/gitlab-secrets.json
• /etc/gitlab/trusted-certs/
• Configuration backup archive complete:
/etc/gitlab/config_backup/gitlab_config_1617158184_2021_03_
31.tar
5
- 7. リストア方法(未検証)
1. Omnibusインストール
2. gitlab-ctl reconfigureの実行
3. GitLabの起動
4. 設定ファイル等の書き戻し
5. バックアップファイルの配置
– 元々の位置に置く
6. 一部プロセスの停止
– unicorn, puma, sidekiq
7. リストアの実行
– gitlab-backup restore BACKUP=バックアップファイル
8. gitlab-ctl reconfigureの実行
9. GitLabの再起動
10. gitlab-rake gitlab:check SANITIZE=true
7