gitlabgitlab-omnibussubgit

How to migrate an svn repo to a gitlab repo


About this: https://docs.gitlab.com/ce/user/project/import/svn.html

Specifically:

The first step to mirror you SVN repository in GitLab is to create a new empty project which will be used as a mirror. For Omnibus installations the path to the repository will be located at /var/opt/gitlab/git-data/repositories/USER/REPO.git by default. For installations from source, the default repository directory will be /home/git/repositories/USER/REPO.git. For convenience, assign this path to a variable:

What is that REPO.git file? Where did it come from? Am I supposed to do this on our gitlab server itself or can I do it on my local machine?

It says just before to place subgit in /opt but this file is in /var/opt/? And either way there's no such path in the subgit archive...


Solution

  • REPO.git is not a file, it stands here for a repository name. It comes from GitLab itself: when you create a project in GitLab UI, it creates the project directory on the mentioned path. Btw, USER here stands for GitLab username; thus, for example, when you log in to GitLab as, say, 'admin' and create a project called 'project', the correspondent 'project.git' directory is being created at the following location:

    /var/opt/gitlab/git-data/repositories/admin/project.git

    for Omnibus installation, or

    /home/git/repositories/admin/project.git

    for installations from source.

    All the actions are supposed to be performed on the GitLab server. Regarding /opt and /var/opt: /var/opt is the place where GitLab stores its files, including projects whilst /opt is where SubGit tool is supposed to be installed. SubGit is not a part of GitLab, it's independent tool for SVN to Git translation; it can be obtained here:

    https://subgit.com/download.html

    and btw, there's another guide how to use SubGit with GitLab:

    https://subgit.com/gitlab.html

    it could be helpful, too.