Subversion Conversion

As promised in my previous post, here are the steps I executed to migrate.NET projects in VSS to Subversion:

NOTE: These instructions will not migrate the file history from VSS.  If you're interested in putting this history in Subversion, see the project.  Additionally, these instructions assume you've installed the Subversion server software, and you have a subversion client running on your workstation.

DISCLAIMER: If these instructions don't work for you, don't blame me - though, I'd be happy to answer any questions you may have : )

  1. Create a new repository in Subversion.  For instructions go here.
  2. Create a tempory directory to work in... call it C:\Temp\Trunk.
  3. Use VSS client, set your working directory to C:\Temp\Trunk and "get latest" on any given VSS project (that contains a.NET solution/project) that you wish to move to Subversion.
  4. Remove the following files from the solution.  They are either VSS specific files or they're VS.NET files that should not be in source control: *.scc, *.vspscc, *.user, *.vssscc, *.suo
  5. *.vbproj or *.*proj or *.dbp - These are project files. When bound to an SCM, these files contain lines beginning Scc. Open these files in Notepad and remove those lines from the project files.
  6. *.sln - These are solution files. When bound to an SCM, these files contain a section delimited by the lines: GlobalSection(SourceCodeControl) and EndGlobalSection This section should be removed from the solution file.
  7. At this point, your.NET projects should not have any dependency on VSS.  If your.NET solution contains one or more ASP.NET projects, go ahead and create the virtual directories in IIS.  Open the.NET solution in VS.NET and compile.  Your projects should compile successfully before moving on.
  8. Using Windows Explorer, delete all /bin and /obj directories that were generated when you compiled.
  9. This step only applies to you if your solution contains one or more ASP.NET projects.  It just so happens that ASP.NET doesn't like directories with a period “.“ in the directory name as in “.svn“.  This is not good because the Subversion clients use “.svn“ folders to manage the files under source control.  So, you have a couple of options.  1)  Install a special “hacked“ version of the TortoiseSVN client (not reommended, but you can find that hack ).  2)  Convert your existing ASP.NET projects to class library projects.  I strongly recommend #2.  After using this approach, I will NEVER use an ASP.NET project again.  In my opinion (I'm allowed to have those since this is my blog), ASP.NET projects try to be too smart with the way it handles IIS mappings.  Configuring Class Library projects into web projects is the way to go!  I'll provide a future post that explains the steps for setting this up.
  10. You should be ready to Import the solution to the Subversion repository.  Perform an 'SVN Import' on the Temp directoy. This will import the Trunk directory and every sub directory under it.
  11. Checkout the code you just imported.
  12. Using a Subversion client, add the following files/directories to the Subversion global ignore list, since it doesn't make sense to keep these in source control:  *.suo bin obj *.user
  13. Commit your changes.
This article is part of the GWB Archives. Original Author: Chad Ernst

New on Geeks with Blogs