Migrate from manual-installed gitlab 7.8.1 to omnibus gitlab-ce 8.14.0

As you may already know, you can only restore your backups in the same gitlab version. So it means that you cannot move your old repositories to the newer version of gitlab using the backup/restore method. Fortunately there is another way to import those repositories into gitlab. Follow these instructions:

In my case, I want to migrate my old repositories from a manual-installed gitlab v7.8.1 to omnibus gitlab-ce 8.14.0 instance which were installed on the same server.

1. Create a group folder in the gitlab-ce's repositories directory:

sudo -u git mkdir /var/opt/gitlab/git-data/repositories/geniuses

2. Copy the old repositories (repositories in gitlab are bare ones):

sudo cp -r /home/git/repositories/* /var/opt/gitlab/git-data/repositories/geniuses/

3. Correct the permissions of the new folder and all of its sub-directories:

sudo chown -R git:git /var/opt/gitlab/git-data/repositories/geniuses/

4. Import the new copied repositories:

sudo gitlab-rake gitlab:import:repos

All the imported repositories will be own by the super admin of the omnibus gitlab-ce instance.

5. Add all existing user to the new imported repos:

sudo gitlab-rake gitlab:import:all_users_to_all_projects

Reference: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/import.md

Comments