tag:blogger.com,1999:blog-25084513.post6761553645050654455..comments2024-03-25T07:58:32.129+00:00Comments on Neil Sleightholm's Blog: Migrating from Visual Source Safe to Subversion (VSS to SVN)Neil Sleightholmhttp://www.blogger.com/profile/07489289165643020423noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-25084513.post-9312094859333767602016-01-17T17:02:02.951+00:002016-01-17T17:02:02.951+00:00It has been a very long time since I looked at thi...It has been a very long time since I looked at this code. There were some comment earlier about using Perl 5.08, may be that will help. I also remember that it was very sensitive to to the date format, I did all my testing with UK format.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-71770409795020093392016-01-11T15:16:53.826+00:002016-01-11T15:16:53.826+00:00MOREOVER:
I have tried to fix the error caused by...MOREOVER:<br /><br />I have tried to fix the error caused by $* in this way:<br /><br />"<br />#$* = 1;<br /> $/ = ':';<br /><br /> $cmd = $SSCMD . " Dir -I- \"$proj\"";<br /> $_ = `$cmd`;<br /><br /> # what this next expression does is to merge wrapped lines like:<br /> # $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/excep<br /> # tion:<br /> # into:<br /> # $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/exception:<br /> s/\n((\w*\-*\.*\w*\/*)+\:)/$1/gsm;<br /><br /> #$* = 0;<br />"<br /><br />and later in the script<br /><br />"<br />#$* = 1;<br /> $out =~ s/\n?Project.*rebuilt\.//gsm;<br /> $out =~ s/\n?File.*rebuilt\.//gsm;<br /> $out =~ s/\n.*was moved out of this project.*rebuilt\.//gsm;<br /> $out =~ s/\nContinue anyway.*Y//gsm;<br /> #$* = 0;<br />"<br />Zetanoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-89129688298572245912016-01-11T14:42:13.196+00:002016-01-11T14:42:13.196+00:00I'm trying to make a migration from VSS to SVN...I'm trying to make a migration from VSS to SVN but I'm not able to make it work...and neither to get the VSS users to be saved in the users.txt file.<br /><br />I show you my command. Premise: I have saved both the VSSRep folder in which it is saved the repository and the folder of the Microsoft Visual SourceSafe program into a folder "migr" savend in C (so the path is C:\migr\VSSRep for the repository). Moreover I have saved in "migr" also a folder "SVNtemp" in which I want to collect the migrated repository.<br /><br />So, my commands are<br />set SS_HOME=C:\migr\Program Files\Microsoft Visual SourceSafe<br />set SSDIR=C:\VSSRep<br />set SVNREPOS=file:///C:/migr/SVNtemp<br />set VSSPROJ="$/ProgettoTest" <br />set CUTOFF=20050701<br /><br />perl migrate.pl --dumpusers --repos=file:///C:/migr/SVNtemp --cutoff-date=20050701<br /><br />and I have this result:<br /><br />"<br />Useless use of sort in void context at migrate.pl line 327.<br />Name "main::DEBUG" used only once: possible typo at migrate.pl line 158.<br />Visual SourceSafe to Subversion Migration Tool - v3.05<br />Original by Brett Wooldridge (brettw@riseup.com)<br />Modified by Magnus Hyllander 2006-12-05<br />Modified by Neil Sleightholm v3.xx<br /><br />SourceSafe repository: C:\VSSRep<br />SourceSafe directory : C:\migr\Program Files\Microsoft Visual SourceSafe<br />Subversion repository: file:///C:/migr/SVNtemp<br />History cut off : Mon Jul 11 00:00:00 2005<br /><br /><br />Migration started: 2016-01-11 15:40:34<br /><br />Building file list: done (0 files)<br />Building file histories: done (0 versions)<br />Building user list: done (0 users)<br />Building user list: done (0 users)<br /><br />Users.txt file has been created. Use the list of users in this<br />file to create matching user accounts in Subversion. Ensure that these<br />accounts initially have NO AUTHENTICATION, otherwise the migration will<br />likely fail. Alternatively, you can use the --force-user option to<br />create all files with the same username. Either way, you can resume<br />this migration, picking up from this point, by using the --resume<br />option on the command line.<br />"<br /><br />Where am I wrong?<br /><br />I thank gratefully whoever will answer. <br />Zetanoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-20148709359824852222009-04-03T08:20:00.000+01:002009-04-03T08:20:00.000+01:00Thank you very much!I found the value with a brute...Thank you very much!<BR/>I found the value with a brute-force: I tried to replace from 200 to 219 with a to t and looked which character is replaced into the ü. In my case, it was 201.<BR/><BR/>I had a similar problem (like some other users) with the date which I solved quickly: my vss (2005) gave me the date in dd.mm.yy not dd/mm/yy, so I had to change the split-command...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-27257440509564735312009-04-02T17:03:00.000+01:002009-04-02T17:03:00.000+01:00You can use charmap to find the values to replace ...You can use charmap to find the values to replace them with (I think you want 252,220,223) the problem is finding out what they current are. If you add:<BR/>if ($DEBUG) <BR/>{<BR/> print STDERR "$comment\n";<BR/>}<BR/>just after the # Translate comment you should see the comments in the migrate.log file. You can then open this in binary mode to see what the character codes are. I hope this helps.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-21673580042372968212009-04-02T11:49:00.000+01:002009-04-02T11:49:00.000+01:00Hi, looks like this is a great script!I have only ...Hi, looks like this is a great script!<BR/>I have only one big problem: I have written my VSS-Checkin Comments in german, which means that there are some special codes (äöü,ß).<BR/>In the script exists a section where these codes get translated:<BR/>"#Translate character codes from CP437/CP850 to UTF-8..."<BR/>The ü is missing, I tried to complement this character, but did not find any codepage where to get it: Either ASCII, CP437 or CP850, nothing worked, it mainly translated 'l' to 'u' or similar.<BR/>Has anyone run into this problem or can tell me the correct character codes for 'ü','Ü','ß'...?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-76126329215981524362009-03-24T15:03:00.000+00:002009-03-24T15:03:00.000+00:00I am using VSS 2005. And I have the option "Act on...I am using VSS 2005. And I have the option "Act on projects recursively" turned on :-( <BR/>Most likely this caused the problems. All the folders were listed recursively. After turning off this behavior with the option -R- everything works fine now.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-31190988383154416142009-03-24T14:16:00.000+00:002009-03-24T14:16:00.000+00:00That is odd -R- means turn off recursion (the fina...That is odd -R- means turn off recursion (the final - negates the option). Are you using VSS 2005 or VSS 6.0 - I used 6.0 for my migrations so that might explain the differences.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-69682643417451136142009-03-24T10:45:00.000+00:002009-03-24T10:45:00.000+00:00I found the solutions.If you use a localized VSS, ...I found the solutions.<BR/><BR/>If you use a localized VSS, just change the language for the SourceSafe user Interface. Start VSS, and select Tools->Options->International Options and change the Application Language.<BR/><BR/>The problem with the folders can be solved, if you change the line (344 at the moment):<BR/> my $cmd = $SSCMD . " Dir \"$proj\" -I- -F-";<BR/>to:<BR/> my $cmd = $SSCMD . " Dir \"$proj\" -I- -F- -R-";<BR/><BR/>With the -R_ option, VSS does not list the folders recursively, which caused the problems.<BR/><BR/>And the "2>$1"? I have no idea, why it is not working. Maybe because I start the tool from a *.bat file. But it seems to work fine without it. I will not get the error messages, but that's fine for me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-74477965465418659732009-03-23T20:49:00.000+00:002009-03-23T20:49:00.000+00:00- Removing those will probably stop it working, th...- Removing those will probably stop it working, they redirect stdout and stderr to the same file. They are standard DOS commands not perl so I am not sure why you would need to remove them.<BR/>- I don't know if anyone has translated the history commands. Have you considered using English VSS just to run the import.<BR/>- I am not aware of any folder issues, may be removing the "2>&1" has caused a problem.<BR/><BR/>If you could create a sample VSS database that demonstrates the problems I will see if I can debug it for you.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-90701276692458830222009-03-23T16:04:00.000+00:002009-03-23T16:04:00.000+00:00Thanks for the script!Testing the script i faced a...Thanks for the script!<BR/><BR/>Testing the script i faced a few issues<BR/>- I had to remove all "2>&1". It did not work with this term. Is the removing "dangerous"? (I don't know perl at all.)<BR/>- We are using a german VSS. Therefor the output of History is in German and I have to "translate" the statements in proc_history. Has someone done this before? (Of course, it's manageable, but why doing it twice?)<BR/>- There seems to be something wrong with the directory-handling. I get a lot of empty directories, which do not exist in VSS.<BR/>- If a directory in VSS has the same name a upper directory, the script does not work. (e.g.: /folder/folder/...)<BR/><BR/>Any help is appreciated.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-45292967164452936802009-02-12T10:43:00.000+00:002009-02-12T10:43:00.000+00:00I've added this for German-VSS users:($day,$month,...I've added this for German-VSS users:<BR/><BR/>($day,$month,$year) = split('\.', $date); # German date formatAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-59622789933613702472009-01-30T00:14:00.000+00:002009-01-30T00:14:00.000+00:00Correct; it goes where Neil has mentioned. I have...Correct; it goes where Neil has mentioned. I have heavily modified the script to migrate directly to Mercurial and will be putting up the final version of the script shortly on my blog (http://chimpchess.blogspot.com) once it's been properly tested.<BR/><BR/>I have ripped out support for multiple VSS projects and added the ability to translate VSS labels into Mercurial tags.Anonymoushttps://www.blogger.com/profile/09361962221454015611noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-1885434260696446132009-01-26T17:10:00.000+00:002009-01-26T17:10:00.000+00:00I think it goes just before line 484:open(HIST, &q...I think it goes just before line 484:<BR/>open(HIST, ">histories.txt");Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-17001699385183015702009-01-26T10:23:00.000+00:002009-01-26T10:23:00.000+00:00Please update me where to apply that code exactly ...Please update me where to apply that code exactly in between lines. I am not that good at scripting.<BR/><BR/>Anywhere in between this will help<BR/>sub build_histories<BR/>{<BR/>my $last_file = "";<BR/>.<BR/>.<BR/>.<BR/>$last_file = $file;<BR/>$last_timestamp = $timestamp;<BR/>}<BR/>}<BR/>.<BR/>.<BR/>.<BR/>.<BR/>open(HIST, ">histories.txt");<BR/> foreach my $hist (@histories)<BR/> {<BR/> print HIST "$hist\n";<BR/> }<BR/> close(HIST);<BR/><BR/> $oldname =~ s/./\b/g;<BR/> $count = @histories;<BR/> print "$oldname\b\b\b\b\b\b\b\b\b: done ($count versions)" . substr($pad, 0, 20) . "\n";<BR/><BR/> $PHASE = 3;<BR/>}<BR/>)<BR/><BR/>Rajesh.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-16402848207864358502009-01-26T10:05:00.000+00:002009-01-26T10:05:00.000+00:00Take a look at Andy Duplain's comment above, I thi...Take a look at Andy Duplain's comment above, I think he found a solution.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-21003300719435813112009-01-26T09:11:00.000+00:002009-01-26T09:11:00.000+00:00I get the same error:Building atoms: 100%ERROR: Fi...I get the same error:<BR/>Building atoms: 100%ERROR: Files would be checked in in an unexpected order<BR/><BR/>Checked by histories.txt files...it shows <BR/>DataAccessFactory.cs,2,2008-03-11 05:12,1205192520,Shinto.t,checkedin,<BR/><BR/>the date format is yyyy-dd-mm.<BR/><BR/>I did the changes to <BR/>Added<BR/>($year,$day,$month) = split('-', $date); # yyyy-dd-mm date format<BR/>Commented out <BR/>#($year,$month,$day) = split('-', $date); # yyyy-mm-dd date format<BR/><BR/>and resumed..<BR/><BR/>still i get the same error message.<BR/><BR/>Please help!<BR/><BR/>Thanks,<BR/>RajeshAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-28281383240304548402009-01-07T19:14:00.000+00:002009-01-07T19:14:00.000+00:00Thanks for the feedback, it just makes me realise ...Thanks for the feedback, it just makes me realise why moving away from VSS was such a good idea!Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-52220861880510786232009-01-07T13:49:00.000+00:002009-01-07T13:49:00.000+00:00I had a similar but legitimate problem where VSS c...I had a similar but legitimate problem where VSS check-ins spanned the DST clock fallback period. As you mention, manually tweaking the histories.txt file and normalizing the dates/times and resuming the migration is an effective way of working around this.the programmerhttps://www.blogger.com/profile/05809305593192973601noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-65108723524268633142009-01-07T13:35:00.000+00:002009-01-07T13:35:00.000+00:00Update: I have fixed this problem by running throu...Update: I have fixed this problem by running through the histories (in build_histories()) and replacing the dates from any out-of-order entries with 01-01-1990.<BR/><BR/>Add this code before the histories are written to histories.txt:<BR/><BR/># If one of the user's had their clock set wrong on their PC then an error will be detected later:<BR/> # ERROR: Files would be checked in in an unexpected order<BR/> # Fix this by adjusting the date to something way back in the past (the real date has been lost so<BR/> # this will not cause anymore damage to the histories).<BR/> my $last_file = "";<BR/> my $last_timestamp = 0;<BR/> for (my $i = 0; $i < $#histories; $i++)<BR/> {<BR/> my ($file, $version, $datetime, $timestamp, $user, $action, $comment) = split(',', $histories[$i], 7);<BR/> if ($file eq $last_file && $timestamp > $last_timestamp)<BR/> {<BR/> $timestamp = POSIX::mktime(0, 0, 0, 1, 0, 90, -1, -1, -1);<BR/> $histories[$i] = join(',', $file, $version, "1990-01-01 00:00", $timestamp, $user, $action, $comment);<BR/> print STDERR "Replaced date on $file v$version as it was out-of-order";<BR/> }<BR/> else<BR/> {<BR/> $last_file = $file;<BR/> $last_timestamp = $timestamp;<BR/> }<BR/> }Anonymoushttps://www.blogger.com/profile/09361962221454015611noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-82808883750669157202009-01-07T11:10:00.000+00:002009-01-07T11:10:00.000+00:00I'm getting "ERROR: Files would be checked in in a...I'm getting "ERROR: Files would be checked in in an unexpected order" and looking into the problem it looks like one of the user's had their clock months out-of-date, and consequently the script is attempting to create version 1 of a file after version 2 has been checked-in. Can anyone suggest a solution to this problem?<BR/><BR/>Thanks,<BR/>AndyAnonymoushttps://www.blogger.com/profile/09361962221454015611noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-11984330392440734852008-12-09T16:33:00.000+00:002008-12-09T16:33:00.000+00:00Thanks... I've used the previous version and now t...Thanks... I've used the previous version and now the latest 3.07 for the last rogue VSS repositories finally being sunset. For Canadian users (running their systems as Canada locale), change the following date format line to enable the migration:<BR/><BR/>#($month,$day,$year) = split('/', $date); # US date format<BR/>($day,$month,$year) = split('/', $date); # CDN date format<BR/><BR/>Other changes I have done do this script:<BR/><BR/>1. lc the $user used during migration to match the format used in SVN (VSS was inconsistent with case in my experience.)<BR/><BR/>2. Load a @passwords hash from my SVN database USERS.CONF and use the correct password for all svn commit commands.the programmerhttps://www.blogger.com/profile/05809305593192973601noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-11925801929792658062008-10-02T18:07:00.000+01:002008-10-02T18:07:00.000+01:00Thanks for the update, I have corrected the US dow...Thanks for the update, I have corrected the US download.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.comtag:blogger.com,1999:blog-25084513.post-91336361330684271372008-10-02T06:20:00.000+01:002008-10-02T06:20:00.000+01:00A coworker and I were using this script, and we ra...A coworker and I were using this script, and we ran into the "ERROR: Files would be checked in in an unexpected order" issue. After looking around the code, we found that the script was not converting the sourcesafe time from 12-hour clock notation to 24-hour clock notation properly when the time is 12am.<BR/><BR/>We made a change that should fix this. I am putting a diff of the change below:<BR/><BR/>*** migrate_us.pl Thu Oct 02 00:02:57 2008<BR/>--- migrate_us-mod.pl Thu Oct 02 00:03:44 2008<BR/>***************<BR/>*** 553,574 ****<BR/>--- 553,579 ----<BR/> #($day,$month,$year) = split('/', $date); # UK date format<BR/> ($hour,$minute) = split(':', $time);<BR/> <BR/> #RJK: If time has trailing a or p then remove it and add 12 to the hour if appropriate<BR/> if ($minute =~ /(..)([aApP])/)<BR/> {<BR/> $minute = $1;<BR/> if ($2 =~ /[pP]/ && $hour != 12) <BR/> {<BR/> $hour += 12;<BR/> } <BR/>+ # TNS/RMB: If the hour is midnight, proper hour should be 0.<BR/>+ elsif ($2 =~ /[aA]/ && $hour == 12)<BR/>+ {<BR/>+ $hour = 0;<BR/>+ }<BR/> }<BR/> <BR/> $year = ($year < 80) ? 2000 + $year : 1900 + $year;<BR/> $datetime = sprintf("%04d-%02d-%02d %02d:%02d",$year,$month,$day,$hour,$minute);<BR/> $timestamp = POSIX::mktime(0, $minute, $hour, $day, $month - 1, $year - 1900, -1, -1, -1);<BR/> if (!defined($timestamp)) {<BR/> print STDERR "$file:\n";<BR/> print STDERR "$line => $year-$month-$day $hour:$minute => $timestamp\n";<BR/> print "\$timestamp is undef!!!\n";<BR/> exit;<BR/> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25084513.post-20648445992003123472008-09-18T17:58:00.000+01:002008-09-18T17:58:00.000+01:00I don't think that is the problem as I was using t...I don't think that is the problem as I was using the same version of Perl. The most likely problems are date format related, there are some comments in the code related to this (the code defaults to UK date format). The other issue is hilighted in an earlier comment and relates to the version of VSS. Feel free to email me directly if you still have issues with this.Neil Sleightholmhttps://www.blogger.com/profile/07489289165643020423noreply@blogger.com