Search code examples
gitazure-devopsmigrationtfvc

what is the correct way for migrating source code of TFVC to git with history?


I came across git-tfs, git-tf and Azure devops migration tools. But which one to use and how is very confusing. Glad If anyone could help help me out

I just want if anyone could simplify the procedure of migrating large repo. with history from TFVC to GIT in Azure devops plateform


Solution

  • Disclaimer: I'm one of the maintainer of git-tfs

    I will try to give you a very high overview of migrating from TFVC to git.

    What you should know is that because TFVC and git works totally differently there is no perfect solution to migrate from TFVC to git (even Microsoft that owned TFVC and switch internally to git have not developed a perfect tool to do that).

    So the good result will depend on how TFVC has been used (lot of branches, merges, folders, ...).

    If you have a large repo, I can already tell you that it will surely be difficult and a pain.

    Microsoft advice is to migrate only the last source code in a new git repository and keep TFVC as a backup the time to have enough history. It could be a solution because of the effort to migrate.

    Azure DevOps migration tools (disclaimer: never used so verify information):

    • Easiest to use
    • Will migrate only 180 days of history
    • (I don't know how it handles branches but I think that it's flat migration without branch support and you have to rework the history in git)

    Git-tf:

    • Made in Java so you could do the migration from another platform than windows
    • Don't support branches (so flat history or just a folder migration)
    • The tool has been deprecated years ago and so, it should work but don't expect support (help or bugfix)

    Git-tfs:

    • Work only on Windows (.net application)
    • Try to support and migrate TFVC branches but it doesn't work perfectly every times due to differences between TFVC and git branches.
    • Performances are better than git-tf but it's still very slow due to how TFVC works.

    As a conclusion, I would say that if you want more than 180 days of history (and maybe branch support), git-tfs is your best option but it could fail or be not perfect and it will be long and painful with a lot of try and error attempts.

    If you achieve to migrate something, my best advice is to verify the last commit of each branch migrated to see if you have EXACTLY the same content than in the last changeset in TFVC. That way, even if the history is not perfect, you could be confident enough on what you are working on.

    And keep TFVC history (long enough) to be able to come back to it if you find something strange.

    You have a more information here: What's the difference between git-tf and git-tfs?