Preparing to migrate

In this section, we will demonstrate how to migrate a TFVC project located on Azure DevOps. First, we will locate our project on Azure DevOps. You can do this by navigating to your organization at https://dev.azure.com. Setting up an organization is outside the scope of this book, but it is quite easy and free if you are a small company or an open source project. You can read more about this on the Azure page, here: https://azure.microsoft.com/nl-nl/services/devops/.

The project page for the git-tfs migration tool can be be found on GitHub (https://github.com/git-tfs/git-tfs). Before you install git-tfs, there are a few prerequisites you need to take into account:

  • You need a Windows machine to install it with.
  • It has to have Git for Windows.

The git-tfs binaries can be downloaded from https://github.com/git-tfs/git-tfs/releases. Alternatively, you can do a managed install with chocolatey (https://chocolatey.org/). Installing with such a package manager takes care of the necessary details for you. Of course, you could build the package yourself because the source is also available. For these examples, we will use a basic Windows machine I already have set up. Let's get started:

  1. It's easy to install Git using chocolatey:

  1. The next step is to install git-tfs using the gittfs package:

  1. In order to perform the migration, we need to create a new project in our GitLab instance so that we have a destination for our Azure DevOps project:

  1. Now, we will use the git-tfs tool to clone the test project we created in Azure DevOps. It will bring up an authentication window:

  1. It will automatically search through changesets and convert them into Git:

  1. To copy this local Git repository to our GitLab project, we need to create a remote entry:
c:gitMovingToGitlab>git remote add origin https://gitlab.joustie.nl:8443/root/movingtogitlab.git
  1. Then, we will use push -u to push it to GitLab. Git for Windows will present you with a login screen, which you can authenticate against gitlab.joustie.nl:

  1. When the migrations are finished, you can log in to your GitLab project. Here, you will find the pushed code:

  1. You can view the commit history in Git with git log:

  1. If you compare it with the history in TFVC, you will find it to be the same:

By using the git-tfs tool, it is relatively easy to migrate your existing TFVC to Git.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.63.87