September 5, 2014

Transferring Changes Between Perforce Servers

MERGE User Conference
Helix Core

Having only one Perforce Server in an organization makes life simpler, and as you know, it can easily scale to support thousands of users and petabytes of data. However in real life, there is often more than one Perforce Server in a single organization, let alone when two or more organizations are sharing development work. An example is the Perforce Workshop, a public Perforce depot that sits outside our internal network.

Sometimes I’ll start a project on one Perforce Server and then realize that it would be nice to replicate these changes to another one. For example, if I’m on the road, I’ll use a local server on my laptop but would like to make the results available on the public server. There are relatively easy ways to do this with a DVCS and our Git Fusion product, but sometimes I just want to easily transfer changes between two Perforce servers.

In our MERGE 2014 presentation, we’ll discuss P4Transfer, an open source solution that Sven Erik Knop wrote and that I’ve enhanced for Perforce customers. It’s written in Python/P4Python and is publically available from the Perforce Workshop.

The basics are pretty simple—have a workspace on each server and sequentially process changes from source to target, syncing files from the source, running adds, edits and deletes as appropriate, and then submitting the changes.

Of course, the devil is in the details, so we’ll cover issues such as:

  • How to handle integrations, including when the source of the integrate is not visible in the workspace
  • Status reporting, including regular updates for when the data being transferred might be hundreds of GBs over a relatively slow WAN
  • Running P4Transfer as a Windows service effectively forever in the background
  • The benefits of having automated tests
  • Issues around Python 2.x and 3.x when handling Unicode filenames on your server

We look forward to seeing you at MERGE 2014!