Gitlab Migrating backups
First, the basic steps
Installing Gitlab with the Gitlab one-click installation package is simple, and the same backup recovery and migration is simple. Use one command to create a full Gitlab backup:
gitlab-rake gitlab:backup:create
Using the above command /var/opt/gitlab/backups
creates a compressed package with a name similar to that in the directory 1393513186_gitlab_backup.tar
, which is the entire complete part of the Gitlab, beginning with the date the 1393513186
backup was created.
Gitlab Modifying the default directory for backup files
You can also modify /etc/gitlab/gitlab.rb
the directory that holds the backup file by default:
gitlab_rails[' backup_path '] = '/mnt/backups '
/mnt/backups
Modify the directory where you want to store the backup, and use the gitlab-ctl reconfigure
command reload configuration file after the modification is complete.
Gitlab Automatic Backup
You can also crontab
automate backups by using Backup commands:
sudo su-crontab-e
Add the following to make an automatic backup every 2 o'clock in the morning:
0 2 * * */opt/gitlab/bin/gitlab-rake gitlab:backup:create
Gitlab Recovery
Again, the Gitlab recovery from backup is very simple:
# Stop related data connection service Gitlab-ctl Stop Unicorngitlab-ctl stop sidekiq# recover gitlab-rake gitlab:backup:restore Backup from 1393513186 numbered backups =1393513186
Gitlab Migration
Migration and recovery process, but there are some considerations
1. The new Gitlab version of the migration must be the same as the original
2. The migration is to copy the name of the Gitlab backup 1393513186_gitlab_backup.tar
to a new server Gitlab backup directory
Perform Gitlab restore the same action
Second, the migration process encountered several errors
1. Migration is unsuccessful, unable to open Gitlab login Home page, 502 error code
Error Analysis:
Execution: sudo gitlab-rake gitlab:check sanitize=true
The following error occurred:
2016-06-15_08:41:41.23074/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activesupport-4.2.6/lib/active_ Support/dependencies.rb:274:in ' require ':/usr/lib/x86_64-linux-gnu/libstdc++.so.6:version ' GLIBCXX_3.4.21 ' not Found (required by/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes/ charlock_holmes.so)-/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes /charlock_holmes.so (Loaderror)
Error Resolution:
sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get update
sudo apt-get install g++-5
2. After the migration of individual items can not be accessed, the page appears 500 error code
Error Resolution:
将 老的 Gitlab 上 /etc/gitlab/gitlab-secrets.json 文件中
"Db_key_base": " 0707b0385c25ca3d9bf56ab9153c86593dd03897777dead5df793bdf67f678577f8543e8ef31c9c6f1651d14237283aa61ccb5859e53cb791bff2daaa 0C47F4C "
The field overwrites the new Gitlab corresponding to the location, restarting the Gitlab problem resolution.
3. The old Gitlab did the Chinese, backup migration has not been Chinese, can be re-Chinese, this does not affect the use of.
4.runner because of problems such as IP address and domain name can not be used properly need to be configured again.
Reference documents
Official Document: Http://docs.gitlab.com/ce/raketasks/backup_restore.html
daily backup recovery and migration after using Gitlab one-click installation package:1190000002439923
Ubuntu Install GCC 5.1:http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04
Post-migration Project cannot access error resolution: https://gitlab.com/gitlab-org/gitlab-ce/issues/17873
Gitlab Migrating backups