Migration Services

On this page

GitHost Migration Services


Support offers migration services from private GitLab instances to GitHost.io instances. This document details the process involved in migrating data to a new instance.


Only the following GitLab instances can be migrated.

  1. Current GitLab version or same version as GitHost.io instances
  2. Omnibus GitLab installation

Backup existing GitLab instance

The customer will need to run a backup of their existing instance by using the backup Rake task.

  1. Verify the GitLab version matches the latest version - sudo gitlab-rake gitlab:env:info
  2. Request the customer creates a new backup (following the steps below):
    1. Create a new backup - sudo gitlab-rake gitlab:backup:create
    2. The new backup will be located at /var/opt/gitlab/backups/{{TIMESTAMP}}_gitlab_backup.tar
    3. Backup /etc/gitlab/gitlab-secrets.json
    4. Compress both the gitlab_backup.tar file and gitlab-secrets.json file.
    5. Upload backup file to Google drive or any other secure location (e.g S3) and provide the link to support.

Restore to a new GitHost Instance

  1. Ensure the instance has been created and is online, do this through the GitHost.io admin dashboard.
    1. If the customer is yet to create the instance, request this is done before proceeding with the restore.
  2. SSH into the customer's instance. For information on how to SSH to a GitHost instance see https://dev.gitlab.org/gitlab/GitHost
    1. Download the backup generated earlier (see Backup existing GitLab instance).
    2. You can use wget or curl to download the backup.
    3. Copy the downloaded backup to /var/opt/gitlab/backups
    4. Set the correct permissions - chown git: /var/opt/gitlab/backups{{TIMESTAMP}}_gitlab_backup.tar
    5. Stop GitLab services accessing the DB - sudo gitlab-ctl stop unicorn; sudo gitlab-ctl stop sidekiq
    6. Restore the backup sudo gitlab-rake gitlab:backup:restore BACKUP={{TIMESTAMP}} - More information can be found on the backup/restore docs
    7. Start GitLab - sudo gitlab-ctl start
  3. Check the instance is online by visiting it directly in your web browser.
  4. Email the customer requesting they check that all data is present.

Google Drive

  1. Request the customer shares the link with @gitlab.com email account
  2. SSH into GitHost instance
  3. Download the gdrive binary. Use gdrive-linux-x64 as GitHost instances are x64. Set the correct permissions.

     curl -L -o "gdrive-linux-x64" 'https://docs.google.com/uc?export=download&id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA'
     chmod 777 gdrive-linux-x64
  4. Authenticate with Google drive (follow the instructions)

    ./gdrive-linux-x64 about
  5. Determine the Google Drive file ID. As an example the fileID for the link https://drive.google.com/open?id=0B7_OwkDsUIgFWXA1B2FPQfV5S8H, is 0B7_OwkDsUIgFWXA1B2FPQfV5S8H (the string after ?id=)

  6. Download the file using gdrive

    ./gdrive-linux-x64 download <FILEID>
  7. Clean up

    Remove gdrive

    rm gdrive-linux-x64
    rm -R ~/.gdrive # this is important as it contains the authentication token

    Revoke permissions

    Visit: https://security.google.com/settings/security/permissions and revoke permissions for the "GDrive App"