views:

997

answers:

4

We have a fairly large SVN repository which we are looking to migrate to perforce. We very much want to keep the ~20k revisions, the branches, etc, but in some initial tests the svn2p4 script that perforce provides wasn't able to replicate the full structure.

Have people had success with this tool, or were there others that my google searching didn't turn up? Best practices and tips are welcome.

+2  A: 

Vitalii Pokrovskii and Mark Fridrich created svn2p4, a perl script that will 'sync and replay' to import every change set into perforce.

You can find it on the perforce wiki. They also gave a presentation about it at the 2007 Perforce User's Conference.

csexton
As the OP says, svn2p4 doesn't work correctly for him: "in some initial tests the svn2p4 script that perforce provides wasn't able to replicate the full structure".
crosstalk
yet this is marked as the answer - Q: tool X doesn't work, what do I do? A: use tool X. lol.
gbjbaanb
I used this script to do a fairly large migration. I had to make a number of fixes and hacks. If you would like my version of the script then let me know.
Paul Ruane
Paul, I'd be interested in your version.
Allan Anderson
A: 

My biggest tip is don't do it. From a usability perspective, perforce is much worse than svn. I'm forced to use it at work, and its much less intuitive than the file based/windows explorer svn interface. Setting up the workspaces is non-intuitive and they're difficult to delete. It occasionally gets confused and won't commit something even though its been changed. Everything is read-only by default. It commits files that are checked out, but unaltered. I could go on...

Steve
First, the Op probably can't change the decision. Second, i found P4 to be a great tool. It is different than SSafe and SVN, but it is certainly not a bad tool. usually companies shy away from it because of the expense.
Tim
I've personally never worked with Perforce, actually, but some ex-Google and Microsoft folk at work swear by it. Our reason for switching is largely due to poor merging in SVN. We'd see conflicts in merging a branch back to trunk when only one of the files had been modified, etc.. too error prone.
Kevin Weil
+1, anyone who thinks Perforce is good is pretty uninformed. I have to work with it every day and while it's better than CVS, it's crap compared to Git.
Paul Betts
I agree with Paul Betts. I have, other the years, used RCS, CVS, SourceSafe, ClearCase, Subversion, Perforce and Mercurial.Perforce is of a similar elk to ClearCase -- it is strong on branching but instists on storing client working-copy state on the server. This can be very irritating when files are modified locally but not checked out. Perforce's handling of changes made to moved/deleted files is also quite poor. I would say use Subversion if that is a palatable choice to the management.
Paul Ruane
Every single complaint you have about P4 is solved with changing a client option.Edit your connection options:1) P4 revert unchanged files : "SubmitOptions: revertunchanged"2) Writeable unchecked out files: Check the "allwrite" check box.3) ... and I could go on ....I use P4 to do the branching and merging ( and to back up svn ) svn gets confused if its damn .svn gets touched at all I have had so many issues that svn cleanup would not solve.
Pat
A: 

I'd second the notion that it just shouldn't be done. IMHO.

If anything I'd move to GIT if anything, but wouldn't touch another source control system that is doing the same thing. It doesn't solve any problems really, and my experience leads me to the simple fact that it isn't going to save you any real time or money in the long run.

Adron
+2  A: 

As fuzzymonk mentioned, it seems the only real option is to use the perl script svn2p4. I've used this a few times and it has worked well although slowly especially with many branches.

One thing that has been very useful with this script is the ability to minimize downtime to virtually none, regardless of geographic distance between servers. This is possible because svn2p4 is fully resumable.

  • First, you take a backup of your svn server
  • While leaving the live server on, you start your import from svn to perforce using the backup.
  • When that import has finished, you can take down your live server and finish the import by pointing svn2p4 to the live server instead of the backup.

This means you only have to take down the server for the few revisions that happened since your last backup. This is especially helpful if your migration is over large geographic distances (svn and perforce servers are far apart) because the large part of your import is done locally, possibly on the same machine, instead of over the internet.

We're in the middle of a large import at the moment (20K revisions, 18GB svn root) and I'm curious as to what kinds of problems you experienced in your initial tests.

Daniel Gill