gitlab數(shù)據(jù)備份
# gitlab-rake gitlab:backup:create
2020-08-11 23:26:51 +0000 -- Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2020-08-11 23:26:56 +0000 -- done
2020-08-11 23:26:56 +0000 -- Dumping repositories ...
* root/testproject (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b) ... [SKIPPED]
[SKIPPED] Wiki
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping uploads ...
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping builds ...
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping artifacts ...
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping pages ...
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping lfs objects ...
2020-08-11 23:26:57 +0000 -- done
2020-08-11 23:26:57 +0000 -- Dumping container registry images ...
2020-08-11 23:26:57 +0000 -- [DISABLED]
Creating backup archive: 1597188417_2020_08_11_12.10.5_gitlab_backup.tar ... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... 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.
#
使用以上命令會(huì)在/var/opt/gitlab/backups目錄下創(chuàng)建一個(gè)名稱類似為1617070883_2021_03_30_13.7.1_gitlab_backup.tar的壓縮包, 這個(gè)壓縮包就是Gitlab整個(gè)的完整部分, 其中開頭是備份創(chuàng)建的日期蒲拉。
gitlab數(shù)據(jù)恢復(fù)
# 停止相關(guān)數(shù)據(jù)連接服務(wù)
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 從1393513186編號備份中恢復(fù)
gitlab-rake gitlab:backup:restore BACKUP=1393513186_gitlab_backup
# 啟動(dòng)Gitlab
sudo gitlab-ctl start
#gitlab-rake gitlab:backup:restore BACKUP=1597188417_2020_08_11_12.10.5
#