Whose Value Is It Anyway? | Home | Reading and Parsing XML In 1 ColdFusion Function

Filed under Architecture on December 27, 2007 by Joel Potischman

Migrating from TFS to SVN

Our 180-day evaluation copy of Microsoft Team Foundation Server expired today. We had decided for a variety of reasons not to purchase it (let the blog comments begin!), and to migrate our .NET source code from TFS to Subversion, which we use for all other projects. Naturally we needed the final copy of the source, and any history we could migrate over easily would be gravy, but we decided that for our needs (and not necessarily yours!), it wasn't worth investing much time or money in preserving all historical details (let the blog comments continue!).

While I found lots of tools and blog posts about migrating from SVN to TFS, I couldn't find anything about going from TFS to SVN without writing lots of code or buying expensive software we'd use exactly once. With a little tinkering I came up with the following method to export source code snapshots by date from Team Foundation Server so that we could commit changes sequentially by week into Subversion.

Yes, it loses check-in and check-out comments, but migrating source metadata would be a lot more work than migrating the source itself, and again, for our needs it was not critical. After all, our code is well organized and self-documenting. Isn't yours?

Hope this is useful for someone else out there. Yeah, it's a bit manual, but so what? In maybe an hour or two of total development+execution time I was all done, and TFS was retired. But by all means, feel free to automate this further and post your improvements.

  1. Create work folder "source" wherever you want
  2. In the work folder's parent, create the batch file TFSGet.bat containing the following three lines:
    cd source
    "c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\TF.exe" get "*.*" /all /version:D%1 /recursive /overwrite
    cd ..
  3. Using the File -> Source Control -> Workspaces command in Visual Studio, point your project workspace to the new work folder.
  4. Run batch file with the first date, i.e. TFSGet 09/01/2007 (must use MM/DD/YYYY format)
  5. Use Subversion tools such as TortoiseSVN to add this initial revision to Subversion.
  6. Delete all the source code from the work folder, leaving the hidden .svn folder created by Subversion.
  7. Repeat steps 4 through 6, incrementing the date by day, week, month, etc. until you get to present day.
  8. Back up your Team Foundation Server databases through SQL Server's maintenance tools, just in case!

Post a Comment Digg Del.icio.us

Trackback Pings (TrackBack URL for this entry)

http://www.arc90.com/cgi-bin/mt4/mt-tb.cgi/93.

Comments

This is very nice, thank you, one question, do you have any similar ideas for work items, I would like to get them into something like JIRA but at least a spredsheet would do!

Posted on June 6, 2008 11:05 AM by Joel Nylund

Sorry, we used Trac for work items, so I only had to migrate source code.

Posted on June 6, 2008 11:10 AM by Joel Potischman

If I have multiple sub folders I need to leave the .svn file in each folder right? Also do I need to force checkin to svn? How does it deal with new folders, deleted folders etc?

Posted on June 11, 2008 4:54 PM by Joel Nylund

Yes, you have to leave the .svn folder intact in all subfolders. As for folders added and deleted over time, remember that your Subversion check-in will only pick up changes in files already tracked by Subversion. You'll have to manually add or remove them in Subversion as you go.

Posted on June 11, 2008 5:01 PM by Joel Potischman

tfs2svn 1.0 has been released at Sourceforge

http://sourceforge.net/projects/tfs2svn/

tfs2svn is a Windows application that converts a Team Foundation Server (TFS) repository into a Subversion (SVN) repository, preserving the history, branches, and commit information.

Let me know if you have any questions.

Posted on September 24, 2008 12:15 PM by Kevin Colyar

Post a Comment:

Whose Value Is It Anyway? | Main | Reading and Parsing XML In 1 ColdFusion Function