Alternative way to migrate to DevOps from old version of TFS? - tfs

According to Microsoft's migration guide (p. 25), the TFSMigrator tool that will migrate data to DevOps only supports the current version and 1 previous version of TFS which means migrating to the newest TFS version is integral in the process.
I'm using an old version of TFS which I wouldn't have too big an issue upgrading except the server it runs on is Windows Server 2008 which doesn't support anything past TFS 2012.
Since all I need is the code repository as it sits today (I don't care about work items, history, or anything else), is there an alternative method for migrating my code?
I'm okay with something semi-manual if necessary. I have about 30 projects to migrate so if I had to migrate project by project, that isn't a big deal. I'm just hoping not to have to recreate each project by hand.

Try git-tfs.
The process is:
Use git-tfs to turn the source TFVC repo into a local Git repo with all of the history preserved
Use git-tfs to "check in" the Git repo to the target TFVC repo
A few caveats:
It's going to be slow.
It's not going to be a full-fidelity migration; you're going to lose the dates of the checkins and possibly the identity of the person who made the checkin in the target system.
An alternative is to spin up a non-production modern TFS environment, clone your team project collection, upgrade it on the non-prod instance, then use the migration tool. That's going to capture everything with full fidelity, and that official tool is the only option you have if you want full fidelity.

Related

Move code from TFVC on TFS 2010 to TFVC on Azure DevOps Server

I have some projects on TFVC source control on TFS 2010. I want just to migrate the source code from TFS 2010 to TFVC on Azure DevOps Server.
I don't want to process an upgrade of the entire collection to a newest version. I Just want to transfer my code with history.
I tried Git-TFS. I cloned my repository on TFS 2010, but I don't know how I can update the remote URL for TFVC repos and push on Azure DevOps Server.
Any ideas how I can do it? Or other tools that I can use?.
In the case I decide to migrate without history how can I do it?
Thanks.
git-tfs is a two-way bridge between TFS (Team Foundation Server) and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.
If you want to move code from TFVC on TFS2010 to TFVC on Azure DevOps 2019 and keep history.
You have to do the upgrade process of entire project collection.
In the case I decide to migrate without history how can I do it
You could just create corresponding new team projects and workspaces. Pull down your source code from your TFS2010 workspaces/projects. Copy and paste source code files/folders in new workspace. Then check in them back to Azure DevOps Server 2019.
We advise you keep preview TFVC repository of 2010 online but read-only to view history.
Same with Azure DevOps Service, hope this helps.
Disclaimer: I'm the last maintainer of the git-tfs tool (even if I no more work on it)
Git-tfs could be used to migrate from TFVC to git (with history and branches if your history is not too complex).
But in no way it could be used to push this history to another empty TFVC project.
So don't expect something from here.
Fun fact (not so fun for you) :
To prevent regression developing git-tfs, I created a TFVC project on Codeplex used to run smoke tests in a Continuous Integration job.
When Microsoft decided to close Codeplex, I contacted a guy working in the source control team inside Microsoft to help me migrate from Codeplex to Azure Devops (at the time called VSTS) which is the problem you try to solve.
I don't know if they put a lot of effort into this but no one was able give me a solution. The only thing they think about was to use git-tfs, that I confirm you is not able to do it!
That could give you an idea of the problem you're trying to solve...
Ps: that also show that TFVC is not an enough flexible source control and their is a much higher added value to migrate to git (like nearly everyone is doing it...)

Migrating from TFS to VSTS with TFVC

My usecase:
Currently have TFS 2012 (on Prem)
Want to move to VSTS
Want to migrate only the SourceCode with history, don't need any workitems, etc.
Questions:
1. What are the tools I can use?
2. Is it mandatory to upgrade to TFS 2018 first before migrating to VSTS
If you want to migrate the source code only then you have 3 options.
The MS recommended route is to upgrade to TFS 2018 and then use the Database import feature of VSTS. This is the only way to keep using TFVC and keep the full history in tact.
You could use OpsHub however this comes with limitations as it will "replay" the history so the changeset history will reflect the time of the migration rather than the time of the original check-in. Also if you have multiple team projects then you might need to pay for the tool.
If you only want the code and you are happy considering changing version control systems from TFVC to Git then this might be the simplest option. You could use Git-TFS essentially you would clone the TFS (TFVC) repository to a local Git repository. At this point you would have a full "copy" of version control including history and branches, but in Git instead of TFVC. You could then push this up to VSTS, the only "downside" is that you would now be using Git rather than TFVC, Git is good, but different so you will want to think about that.

Migrate TFS Changesets

I assumed this would be easy, but I'm not finding anything on it...
I have a project in TFS 2010, which needs to be moved to a new TFS 2015 server. Apparently the project cannot simply be moved normally because it's using a different project template which is not compatible and causes errors when trying to migrate (so I'm told - I don't have any more details on this).
I'm looking for a way to bring over the changesets, keeping history, to the new server. I assumed there was some kind of "dump" where you could export the TFS changesets, then import them into the new server into an empty project - but I'm not finding that option.
TFS Integration is deprecated and apparently doesn't work for TFS2015, with no alternative listed.
I'm open to other creative options like temporarily exporting to a different version control system - for example, I've looked at SVNBridge, but I can't even get that working, let alone figure out if it would help here.
Is there a way to migrate all changesets for a given project and keep history, without migrating the entire project?
There is no default way to migrate changesets in TFS, you would need 3rd party tool, like OpsHub (some features are not free), to migrate the most commonly requested data. Check: http://www.opshub.com/products/opshub-visual-studio-migration-utility/
Or you may consider doing a upgrade from TFS 2010 to TFS 2015, which is a full data transfer. To understand factors that affect your upgrade's compexity, check the requirements and review the upgrade process.
Learn if a dry run makes sense for you, and weigh the benefits and the costs to perform a pre-production upgrade.
When you're ready to upgrade, minimize downtime with the TfsPreUpgrade tool - especially for very large TFS collection databases (> 1 TB). Follow these steps for how to upgrade TFS.

Can I utilize two different versions of TFS to manage source code?

I am not familiar with TFS, however the scenario that I will be coming across is that I will have a branch of source code stored in Visual Studio Team Services (was TFS Online) and locally I will be running TFS 2008.
Would there be any issues pulling the code from Team Services and merging with TFS 2008?
You won't be able to bind the code (solution and projects) to 2 different TFS servers. If you're using the online version of TFS what reason would you have of also trying to store the code in a local repository?
You definitely won't be able to merge the code between the different servers. TFS is a centralized version control system and merge operations need to be handled and tracked by the server.
You could theoretically Manage the code in one of the TFS servers (i.e. have the solution bound to TFS online) and manually manage the code in the other server. However TFS 2008 only supports local workspaces which means that it will make files read only if they are not explicitly checked out. This will cause you no end of pain.
Even if you did it the other way round (made the local TFS server the "master") you will almost certainly create yourself a load of problems as TFS simply isn't designed to be used this way
Also TFS 2008 is pretty ancient and unsupported.
EDIT:
The typical TFS workflow is.
Create a development branch on the server.
"Get" the code to a local folder on your dev machine (called a workspace).
"Check out" the files you need to modify from your branch or "Add" new files as needed.
You should regularly "check in" files to your branch to make sure your changes are saved on the server.
When your changes are complete then "merge" the code from the development branch back to the Main branch.
The code is stored and versioned on the server, but your changes are made on your local machine. To interact with the server you use the Team Explorer plugin in Visual Studio. Modern version of Visual Studio have Team Explorer built in.
If you're using the online version of TFS then you'll want to use Visual Studio 2012 or above.
If you're planning on Forking the code and do not plan on committing your changes back to the server, then you're probably better off using something like Git. You could use Git-tf or Git-TFS to pull changes from TFS and then that would make merging a lot easier and you could use your local Git Repo to manage your own changes

Where can I get large sample TFS repositories?

I'm building a tool to integrate with TFS and it needs to properly parse TFS logs (from the tf.exe history command) and checkout different revisions (again using tf.exe). It works great on the test TFS server I have, but I want to test it on a broad range of large repositories to make sure my parsing works properly.
I'd hoped to use Codeplex to get access to TFS repositories, but it seems you only get TFS access to Codeplex projects if you're a project member.
Are there any collections of open source code hosted on public TFS servers? Are there any other publicly available servers I could use for testing?
I would suggest using svn2tfs and choose any relatively active project on SourceForge. There are plenty of projects on SF to choose from that use SVN and not CVS. You might even get a bonus out of it and help the svn2tfs project work out any kinks.
Since you mention tf history command, I assume you want to collect/parse logs on the project's (and its files) history of checkins.
So in addition to large repository, you also need a good amount of history, am I right? If yes, then here's your set of problems:
Most projects on codeplex use Mercurial, not TFS. So even if you get access, you cannot use TFS with them.
As you mentioned, they require you to a be a member for you to access the source.
Even if you get access or find a public server (unlikely), you still would need good amount of history.
If I'm correct in my assumptions so far, here's the easiest (bit tedious though) way out:
Go to any large projects's such as Nuget or Wix
revisions
Download any old revision (go back as far as you want the history for). You can download zipped src files without being a member.
In your test server, checkin the code (src) to create the baseline.
Download the next revision.
Checkout files in your server and overwrite them with the newer revision's files.
While checkin, use the history.txt (sample) to create checkin comments
Repeat this process few times.
Voila!! You now have a large repository with lot of history!
Hope this helps.
Have you tried some of the larger projects on Codeplex?
http://www.codeplex.com
If you only need read access you should be able to play around with the various repositories.
I don't have a huge amount of tfs experience, but I would assume there are migration tools that let you ingest code repositories from other products (e.g svn or hit).
If so, you might want to find a svn/git repo for a sizable foss project, and try importing that.
"I'd hoped to use Codeplex to get access to TFS repositories, but it seems you only get TFS access to Codeplex projects if you're a project member."
This solution appears to be the general consensus amoung SO'rs. I've read some of the Codeplex TFS connection problem threads (you linked to below) and I hope the comments in this thread resolves the issue:
Connecting to Codeplex TFS as a Coordinator or Developer.
I'm wondering if you can use git-tfs project to import an existing Git project into TFS.
Download and install git-tfs
Create a new TFS project
Clone the TFS project to a Git project using git-tfs ("git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project")
Import a existing Git project of your choice into your fresh new Git project (I don't know the command but I think it's possible).
Use git-tfs to checkin to TFS Server ("git tfs checkintool")
=> Do it makes sense ? And works ?
For more information:
http://lostechies.com/jimmybogard/2011/09/20/git-workflows-with-git-tfs/

Resources