[root@test102 ~]# cat /etc/gitlab/gitlab.rb |grep "backup_path" |grep -Ev "^$" # 确认备份目录 gitlab_rails['backup_path'] = "/var/opt/gitlab/backups" [root@test102 ~]# [root@test102 ~]# ll /var/opt/gitlab/backups/ # 确认备份文件 total 172 -rw-r--r-- 1 git git 174080 Nov 27 16:12 1574842330_2019_11_27_12.5.0_gitlab_backup.tar [root@test102 ~]# [root@test102 ~]# gitlab-rake gitlab:backup:restore BACKUP=1574842330_2019_11_27_12.5.0 # 还原 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 Removing all tables. Press `Ctrl-C` within 5 seconds to abort 2019-11-27 16:40:03 +0800 -- Cleaning the database ... 2019-11-27 16:40:05 +0800 -- done 2019-11-27 16:40:05 +0800 -- Restoring database ... ...... ...... ...... [DONE] 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring repositories ... 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring uploads ... 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring builds ... 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring artifacts ... 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring pages ... 2019-11-27 16:40:19 +0800 -- done 2019-11-27 16:40:19 +0800 -- Restoring lfs objects ... 2019-11-27 16:40:19 +0800 -- 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
GitLab Shell: ... GitLab Shell version >= 10.2.0 ? ... OK (10.2.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... can't check, you have no projects Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 3 Is authorized keys file accessible? ... yes