Migrating from SVN to Perforce — Tips? Experience?

2019-04-07 21:01发布

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.

4条回答
姐就是有狂的资本
2楼-- · 2019-04-07 21:06

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...

查看更多
疯言疯语
3楼-- · 2019-04-07 21:09

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.

update 2012: Another solution is to use p4convert-svn. Details here: p4convert-svn at perforce site

查看更多
啃猪蹄的小仙女
4楼-- · 2019-04-07 21:09

This issue is probably totally dead, but just FYI, there's a lot of useful information in Scott Bilas's blog post here: http://scottbilas.com/blog/subversion-to-perforce-post-mortem/

He mentions some of the specific issues with svn2p4 and how to work around them (when such workarounds are possible.)

I've just started using Perforce after years with Subversion, so I'm on the steep part of the learning curve.

查看更多
趁早两清
5楼-- · 2019-04-07 21:27

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.

查看更多
登录 后发表回答