GitLab backup creation and recovery
It is very easy to install Gitlab using the one-click installation package of Gitlab, and the same Backup Recovery and migration are also very simple. Use a command to create a complete Gitlab backup:
Gitlab-rake gitlab: backup: create
Use the above command to create a compressed package named 1393513186_gitlab_backup.tar under the/var/opt/gitlab/backupsdirectory. This compressed package is the complete Part of Gitlab, with 1393513186 starting with the backup creation date.
Gitlab modifies the default directory of the backup file
You can also modify the directory where the backup files are stored by default by modifying/etc/gitlab. rb:
Gitlab_rails ['backup _ path'] = '/mnt/backups'
/Mnt/backups modify the directory where you want to store the backup. After the modification, use the gitlab-ctl reconfigure command to reload the configuration file.
Gitlab automatic backup
You can also use the crontab command to implement automatic backup:
Sudo su-
Crontab-e
Add the following to implement automatic backup at every day:
0 2 ***/opt/gitlab/bin/gitlab-rake gitlab: backup: create
Gitlab recovery
Likewise, Gitlab's recovery from backup is very simple:
# Stop related data connection services
Gitlab-ctl stop unicorn
Gitlab-ctl stop sidekiq
# Recovering from backup of 1393513186 #
Gitlab-rake gitlab: backup: restore BACKUP = 1393513186
# Start Gitlab
Sudo gitlab-ctl start
Gitlab migration
Migration is like the backup and recovery steps, you only need to copy the backup files under the/var/opt/gitlab/backups directory of the old server to the/var/opt/gitlab/backups directory of the new server (if you have not modified the default backup directory ). however, you must note that the Gitlab version on the new server must be the same as the Gitlab version when the backup is created. for example, if the new server is installed with Gitlab of the latest version 7.60, you 'd better upgrade Gitlab of the old server to 7.60 before migration.
For more GitLab tutorials, see the following:
GitLab Installation Guide in Ubuntu 14.04
How to install Gitlab in Ubuntu Server 14.04
Install GitLab in Chinese with CentOS source code
Install GitLab on Ubuntu 12.04
GitLab 5.3 upgrade considerations
Deploy GitLab on CentOS (self-managed Git project repository)
Install GitLab 6.0.2 on RHEL6/CentOS6/ScientificLinux6
CentOS 6.5 GitLab installation tutorial and Related Problems
GitLab details: click here
GitLab: click here
This article permanently updates the link address: