1

We are looking into the possibility of migrating from TFVC to GIT in Azure DevOps. There is a tool that looks like it should work for us, but it will not move the source code to the repository it creates. Our TFVC source tree resembles the below structure.

  • $/Contoso
  • $/Contoso/GreatApp1
  • $/Contoso/GreatApp1/Main (Branch)
  • $/Contoso/GreatApp1/Main/Source (folder with source code)
  • $/Contoso/GreatApp1/Main/Documentation (project documentation)
  • $/Contoso/GreatApp1/Dev (Branch)
  • $/Contoso/GreatApp1/Dev/Source (folder with source code)
  • $/Contoso/GreatApp1/Dev/Documentation (project documentation)

At the very least, I would like to convert the Main branch with documentation and source code. We have 40-50 projects that follow this structure under a single project collection, so ideally I am hoping to do this using this tool without having to rebind source control in all of the different projects. Is what I'm wanting to do possible?

riQQ
  • 9,878
  • 7
  • 49
  • 66
Brian Swart
  • 922
  • 1
  • 9
  • 25
  • The answer is probably in the last line of the link you gave or in https://learn.microsoft.com/en-us/azure/devops/learn/git/migrate-from-tfvc-to-git#advanced-migrations Try https://github.com/git-tfs/git-tfs – Philippe Mar 23 '21 at 22:12
  • You mentioned "it will not move the source code to the repository it creates", could you let us know what error did you get? – Cece Dong - MSFT Mar 24 '21 at 09:33
  • Related: https://stackoverflow.com/questions/56592193/migration-issue-from-tfvc-to-git https://stackoverflow.com/questions/63957700/how-to-migrate-tfvc-to-git-including-history https://stackoverflow.com/questions/58312097/tfvc-to-tf-git-migration-repo-organisation-incl-multiple-solutions-and-build – riQQ Mar 24 '21 at 18:35

1 Answers1

1

The import experience is optimized for small, simple TFVC repositories or repositories that have been prepared for a migration. This means it has a few limitations.

  1. It only migrates the contents of root or a branch. For example, if you have a TFVC project at $/Fabrikam which has 1 branch and 1 folder under it, a path to import $/Fabrikam would import the folder while $/Fabrikam/<branch> would only import the branch.
  2. The imported repository and associated history (if imported) cannot exceed 1GB in size.
  3. You can import up to 180 days of history.

If you want to attempt an advanced migration with Git-TFS, that project provides documentation on how to do a migration from TFVC to Git, cloning a single branch with history or cloning all branches with merge history.

let’s follow the migration guide and execute the clone command:

git tfs clone {TFVC repo URL}

Get all branches:

git tfs branch –init --all

For each branch, run these commands:

git checkout branch

git log -1

git tfs pull -c=changesetNumber

Create a new repo in the azure devops and get the repo URL. Then setup the git repository upstream:

git remote add origin {New repo URL}

Finally you push all your local changes to the Remote.

git push origin -u -all

Useful link:

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • The command you posted for grabbing all the branches has a typo in it (`--init` and not `-init`). Also, this command is grabbing the entire history and so, so why it's required to grab all the changesets at hand by providing the changeset number? The version used: `git-tfs version 0.32.0.0 (TFS client library 16.0.0.0 (MS)) (64-bit)` – HellBaby Apr 20 '23 at 14:30