Reputation: 83
We are planning to migrate from tfvc to Git version control.
We have some GBs of code and thousands of changesets. I read some articles and went through Microsoft documentation and found 2 options.
tip migration - where I can use Azure Devops built-in tool "Import Repository". It has limitations like Imported repository should be 1GB and we can get 180 days of history.
Git TFS - This suites my requirement. But not sure if it can migrate entire code and entire history.
How can I achieve this? And are there any options other than this?
Upvotes: 3
Views: 5358
Reputation: 31137
GIT-TFS - This suites my requirement. But not sure if it can migrate entire code and entire history.
Because how TFVC and Git store the data are very different, no tool is perfect. So you will have to try many things and find the way that best suits your needs. But I'm pretty sure none will be perfect.
Here your really 2 options are git-tfs and git-tf.
But with some advantages for git-tfs. See:
What's the difference between git-tf and git-tfs?
How can I achieve this?
I can't say much than what I already put in this documentation : https://github.com/git-tfs/git-tfs/blob/master/doc/usecases/migrate_tfs_to_git.md
But because this kind of migration is not a perfect process, you will have to do a lot of trials and errors until you find the good way for you to do it. So start with a small history because retrieving the data from TFVC is quite slow 😕
And are there any options other than this?
There are but none is a perfect solution (but still are solutions to try)
https://github.com/viceroypenguin/tfs-fast-export https://github.com/kunom/tfsdb-fast-export
If you search well you will find other custom solutions that worked 1 or 2 times for a specific migration...
tip migration - where i can use Azure Devops built-in tool "Import Repository". It has limitations like Imported repository should be 1GB and we can get 180 days of history.
The bigger is your history, the less it makes sense to migrate ALL the history. So it could makes perfectly sense to migrate just some months and kept the TFVC history as an archive.
And you could also try to replicate this 'tip migration' with git-tfs or git-tf by just selecting from which changeset you want to start your migration.
When the TFVC history is very strange and that you don't really need it, a last resort could be to start from the checkout of the last changeset. That is what Microsoft advise (even if I don't totally agree on that).
The success of such migration is to be flexible, accept that it surely won't be perfect (mostly due to the insane way TFVC store the data and let you do strange things) and find the good way to move on!
Upvotes: 2
Reputation: 2732
The git-tfs and git-tf tools work pretty well. Git-tfs has some good documentation in the readme. Just bear in mind how this works, though. TFS is pretty limited. What happens is that you will extract all of the tfs history and create a local git repository from it. From there you can put to any git remote you want. It should be able to preserve the history and author names just fine. If you are moving to git in Azure DevOps, there is a migration tool that can help you.
Also, bear in mind that this is a popular question and has been asked before.
Upvotes: 1