Visual Sourcesafe 3.1 is the devil's repository. I spent the last few weeks at work wrangling the out-dated repository system into a subversion repository. The entire process involved a lot of experimentation because the sourcesafe 3.1 mechanisms for detailing file history are somewhat difficult to figure out.
I originally started with the intent of using Polarion's SVNimporter tool. It turned out that solution was not sufficient. It was meant for a newer version of sourcesafe. Our version here at work dates back to the 90's.
I ended up writing about 1500 lines of code in perl. The process of converting the repository can be distilled into 3 steps:
- Dump all of the sourcesafe history into a file. (This can take almost an hour, depending on the size of your repository).
- Parse the history file and sort it by date. (This part takes the longest, because the history file will not be sorted by date, and it is often several gigabytes in size).
- Convert the parsed history into an svn dump file. (This involves translating the sourcesafe behavior into subversion behavior. A direct mapping is not always possible).
This was a difficult thing to test as well. Some errors would only be revealed after several hours had passed during a test run. The 1st and 2nd step usually took the longest. It was difficult to engineer the system because I was unfamiliar with the sourcesafe system at the start. For example, sourcesafe does not maintain the history of files that have been "Removed" in the history output. Therefore, it was necessary to "Restore" all of the removed files before retrieving the history. This is the sort of thing that I needed to learn from painful experience.