Gitlab Data Migration

Source: Internet
Author: User

Migration Environment Preparation:

Gitlab data migration needs to be done between the same version. Because of the different versions of Gitlab, the database table structure and the way the program is implemented are different. If you need to migrate Gitlab data from Server A to Server B, Server B needs to deploy the same version of Gitlab as Server A.

Migration Implementation Mode:

You can use the Gitlab backup and restore command to implement data migration.

Backup:

Bundle EXEC Rake Gitlab:backup:create rails_env=production

The backup command backs up the warehouse and MySQL data for all projects in the local Gitlab.

Recovery:

Bundle EXEC Rake Gitlab:backup:restore rails_env=production backup=timestamp

The restore command imports the MySQL data from the backup and the Project repository directory, and can refactor the ~/.ssh/authorized_keys authentication file from the data in the MySQL library as needed.


Migration operations:

Server A:

#su-GIT$CD gitlab$ bundle exec Rake gitlab:backup:create rails_env=production

If run error-free, after the backup succeeds, a backup tar package is generated under the backup directory (default =/home/git/gitlab/tmp/backups), which contains the Gitlab project repository and MySQL export data.

File formats such as: 1449731757_gitlab_backup.tar, where "1449731757" is the timestamp of the backup file.

Upload the backup file to Server B's backup directory.


Server B:

#chown GIT.GIT/HOME/GIT/GITLAB/TMP/BACKUPS/1449731757_GITLAB_BACKUP.TAR#SU-GIT$CD gitlab$ Bundle exec Rake Gitlab: Backup:restore rails_env=production backup=1449731757

Note here the "backup=1449731757", where you need to fill in the time stamp to recover the file.

If it runs correctly, the data migration is complete.


Note: The default backup directory for Gitlab can be modified in/HOME/GIT/GITLAB/CONFIG/GITLAB.YML:

$vi/home/git/gitlab/config/gitlab.yml backup:path: "Tmp/backups"



This article is from the Linux OPS blog, so be sure to keep this source http://icenycmh.blog.51cto.com/4077647/1723296

Gitlab Data Migration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.