Gitlabバックアップ移行リカバリ(bug:gitlab-ce.0.8.x restore)

3268 ワード

1.バージョン情報
OS: centos 6.9 
Gitlab: gitlab-ce.10.7.4 gitlab-ce.10.8.0 gitlab-ce.10.8.3 gitlab-ce.10.8.4

2.データバックアップ
 https://segmentfault.com/a/1190000014729115
  url  。

3.Gitlabデータ復元
 https://segmentfault.com/a/1190000014729115
  url  。

4.Gitlabデータの復元に失敗した
 :gitlab restore bug, 。
issue:https://gitlab.com/gitlab-org/gitlab-ce/issues/46891

first:
#scp 1528963129_2018_06_14_10.8.4_gitlab_backup.tar 192.168.99.115:`pwd`
#chown git.git /var/opt/gitlab/backups/*.tar
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore

** :**
[DONE]
done
Restoring uploads ...
tar: .: Cannot mkdir: No such file or directory
tar: Exiting with failure status due to previous errors
Backup failed

 , , ! , , ;

5.Gitlabのバックアッププロセス
Dumping database ... 
Dumping PostgreSQL database gitlab hq_production ... [DONE]
done
Dumping repositories ...
 * arch/k-calc ... [DONE]
 * arch/sms ... [DONE]
 * 
done
Dumping uploads ... 
done
Dumping builds ... 
done
Dumping artifacts ... 
done
Dumping pages ... 
done
Dumping lfs objects ... 
done
Dumping container registry images ... 
[DISABLED]
Creating backup archive: 1528963129_2018_06_14_10.8.4_gitlab_backup.tar         
... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
done
done
done
done

 tar ,db   repositories  !! 

 , ,  !!!

6.データ復元プロセス
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
Cleaning the database ... 
done
Restoring database ... 
Restoring PostgreSQL database gitlabhq_production ... SET
SET
SET
 set_config 
GRANT
[DONE]
done
Restoring repositories ...
 * arch/k-calc ... [DONE]
 * arch/sms ... [DONE]
Put GitLab hooks in repositories dirs [DONE]
done
Restoring uploads ... 
....

7.データ復元の解決
#cd /var/opt/gitlab/backups
#ls 
1528963129_2018_06_14_10.8.4_gitlab_backup.tar  backup_information.yml  db                      
pages.tar.gz  tmp artifacts.tar.gz builds.tar.gz lfs.tar.gz  repositories      
uploads.tar.gz

restore handy:
#tar xf uploads.tar.gz -C /var/opt/gitlab/gitlab-rails/uploads
#tar xf builds.tar.gz -C /var/opt/gitlab/gitlab-ci/builds
#tar xf pages.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/pages
#tar xf artifacts.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/artifacts

 , Gitlab , !!!

 : db、repositories  , , !!!

 , , !!!

# 
#gitlab-ctl reconfigure
#gitlab-ctl restart
#gitlab-rake gitlab:check SANITIZE=true

8.新旧ドメイン名変更redirect
#grep -rn "external_url" /etc/gitlab/gitlab.rb
  external_url "http://gitlab.xxxxx.com"
#gitlab-ctl reconfigure
#gitlab-ctl restart

redirect  :
     admin area, setting, “ ”  Home page URL, !!!

フォルダ権限リファレンス
https://docs.gitlab.com/omnibus/settings/configuration.html
    

問題があったり、賞をあげたい場合は、宝を支払います[email protected] !!!