Skip to main content

Team Foundation Server: How to migrate TFS Version Control project by project

One of the customers I work for is making the move to Team Foundation Server. For the project I’m working on, we used a temporal TFS project hosted at my employer(Ordina). Unfortunately there wasn’t an easy migration path to move the source code from the Ordina TFS to the TFS at the customer location. Why? Because we are using SQL Server 2014 and the customer has standardized on SQL Server 2012. And this is an unsupported migration path.

Luckily, I found a workaround to not lose any history. In short, what I do is export all the source code in TFS Version Control(TFVC) from my company’s TFS to a Git Repo. Afterwards I import the code from Git  into the TFSVC from the customer.

Interested in the specific steps? Here are all the details:

Prerequisites

I used a combination of 2 tools that support integration between TFS and Git. (Why 2 tools? Because I had some issues when I tried to accomplish the process with only one of the tools.)

Export the code from TFSVC into Git using Git-TFS

  • Download and install the Git-TFS binary
  • Add the git-tfs folder path to your PATH environment variable
  • Open a command prompt
  • Check which branches are available for cloning
  • Clone the full repository or a specific branch(note that this can take a while…)
  • After the clone operation has completed, you have the full TFS history available in a local git repo

Import the code from Git into TFSVC using Git-TF

  • Let’s now switch to the Git-TF tool. Download and install it from the Microsoft Download site.
  • Add the Git-TF installation path to your PATH environment variable
  • Open a command prompt
  • Browse to the location where you have the local git repo created
  • Configure git-tf to link to the target tfs repo
  • Do a check-in of the Git repo in TFS
    • git-tf checkin --deep --verbose

Popular posts from this blog

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

.NET 9 - Goodbye sln!

Although the csproj file evolved and simplified a lot over time, the Visual Studio solution file (.sln) remained an ugly file format full of magic GUIDs. With the latest .NET 9 SDK(9.0.200), we finally got an alternative; a new XML-based solution file(.slnx) got introduced in preview. So say goodbye to this ugly sln file: And meet his better looking slnx brother instead: To use this feature we first have to enable it: Go to Tools -> Options -> Environment -> Preview Features Check the checkbox next to Use Solution File Persistence Model Now we can migrate an existing sln file to slnx using the following command: dotnet sln migrate AICalculator.sln .slnx file D:\Projects\Test\AICalculator\AICalculator.slnx generated. Or create a new Visual Studio solution using the slnx format: dotnet new sln --format slnx The template "Solution File" was created successfully. The new format is not yet recognized by VSCode but it does work in Jetbr...