1

I have a client server that has limited rights (no internet or many install priveleges), but it contains a version of TFS. Is there any way possible to get the data and history to bring down to my local computer to put into GIt?

I have tried Git-TFS but cannot get it installed on the server and tried running the source code.

Any ideas besides me downloaded the code for each branch and then adding them in branch by branch and ignoring the previous commits of each branch?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
cdub
  • 24,555
  • 57
  • 174
  • 303
  • 2
    Git-tfs even if not perfect is your best option. TFVC is so slow and so different than git that I will never go for the manual migration except if you accept to migrate only the tip of the branches (and keep TFVC as backup history the time to rebuild a descent history) – Philippe Dec 02 '22 at 23:02
  • I agree, there exist nothing better than git-tfs. You do not need to have git-tfs running on the server, you can clone the repo from any machine. – hlovdal Dec 02 '22 at 23:24
  • Yes but the server has no Internet and I cannot access it from local. I hate TFS and don't understand why it was chosen, but I think I can only get the tips of the branches as I do not understand how to run git-tfs on the server without have some rights. Any ideas? – cdub Dec 03 '22 at 00:03
  • Does it matter why it was chosen, depending on how long ago the choice was made or on the knowledge of the people working on it at the time, it may have been the 'right choice'. Even if it no longer is. – jessehouwing Dec 03 '22 at 11:52
  • Also remember, TFS is the server, but it hosts git repos as well since forever (2012). Basically a project admin can create both TFVC repos as well as Git Repos. No need to hate TFS, though I can totally understand that after you've gotten used to Git, you never want to go back to TFVC (Team Foundation Version Control). – jessehouwing Dec 03 '22 at 12:07
  • @jessehouwing since you are well equiped, is there anyway an admin can make a file in TFVC into Git and then I can use Git to get the changeset and then get it into a git repo on our servers GL, BitBucket, GH, etc.? TFS is being removed (I have no contorl over that part). thanks – cdub Dec 05 '22 at 18:44
  • @cdub on the TFS server, if it is recent enough, up to a certain number of days of history from a single branch can be converted to a git repo. Alternatively, you can use Git-TFS to fetch all branches of a tfvc repo. Once converted, you can `git clone --mirror` the repo to a local drive and then use that to `git push --mirror` to a new hosting server. – jessehouwing Dec 05 '22 at 20:05
  • GitHub also has a TFVC import feature, but I'm not 100% sure it's working at the moment. Me and my colleagues regularly get called into a client to assist them in this process, cause it can be a bit tricky. – jessehouwing Dec 05 '22 at 20:07
  • 1
    Thanks @jessehouwing. I'm working on seeing what permissions the client will give me to grab the data and get it local. – cdub Dec 05 '22 at 20:14
  • This is the doc to the current GitHub Importer tool https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/about-github-importer – jessehouwing Dec 06 '22 at 09:06

2 Answers2

1

Depending on the version of TFS on the server, it could have a built-in option to import the TFVC history into a git repo on the same server. Afterwards you can mirror-clone it to disk and copy it. This will grab a limited history from a single branch though.

Git-TFS doesn't need any special privileges on the server to run, so instead of using the installer try creating a portable version by copying the installed bits from your own workstation.

You'll need a couple of things:

  • A portable version of git.
  • A portable version of tf.exe (you can copy the team explorer folder from a Visual Studio installation)
  • A portable version of Git-TFS.

Open a command prompt, add the paths to the 3 executables to your path variable and run the tool. It should just work.

In extreme cases I'd get a copy of the TFS databases, install a local copy of TFS/Azure DevOps Server on my machine and attach the databases. That way you have full access to the contents in the server to run whatever tools you need to use without having to install anything in the original server.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • Yes I will drive this a try. I have full Git on my local just need the tf.exe then and not sure if I have access to that. – cdub Dec 04 '22 at 22:09
0

Yes but the server has no Internet and I cannot access it from local.

The client would have to export a zip file per branch HEAD, in order for you to import said branches in a new Git local repository.

That would indeed ignore commits done in each branch, which is standard for "complex" migration (where you keep the old repository for reference)

But you would still need to export back the new repository back to the client, which you can do with git bundle.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250