Migration using remote depots and p4 integrate

Data transfer using remote depots

Data transfer between servers is accomplished by defining a special 'remote' depot type.  The remote depot is located on your local Perforce server, and acts a pointer to a 'local' type depot in the remote server.

Control over which files are available to the remote depot resides in the remote server rather than the local remote depot.

Data access from the remote depot is read-only from the local server, and only files and file revision data are accessible from the local server.

Defining a remote depot on the local server

Remote depots are configured on the local server side by defining a depot of type remote:

Depot name: from-remote
Type: remote
Address: from-remote:1666
Map: //depot/outbound/...

This remote depot specification points to the remote server with its 'Address' specification, the format of this field is identical to how a 'P4PORT' variable would be configured.

The 'Map' field points to the desired portion of the remote server's namespace.  This mapping must be a single line and include the '...' wildcard on its right side.

Enabling a remote depot on the remote server

In order to access the data in the remote perforce server, the administrator of the remote server must grant read access to either virtual user 'remote' for the directories specified in the remote depot on the local server.  Note that in servers older than 2010.2 only the 'remote' user can be used to access remote servers, in 2010.2 or later either the 'remote' user or the service user of the accessing (local) p4 server can be used.

By default, all files on a Perforce server can be accessed remotely (read-only).  It is recommended that the following line be added to p4 protect tables to prevent this access except where authorized:

list user remote * -//...

If both sites are at Release 2010.2 or higher and the local p4 server has a service user named 'service-myserver' and is hosted on IP address <my ip address>, the protection table on the remote server looks like:

list user remote * -//...
list user service-myserver * -//...
read user service-myserver <my ip address> //depot/outbound/...

Transferring data from the remote server

Once the remote depot and source depot on the remote server are configured as above, a local perforce user can perform a 'p4 integrate' command to bring the data from the remote depot defined on the local server into another depot on the local perforce server.

The integrate command (assuming the remote data would be put in data 'depot' under /externaltransfer) would look like this:

p4 integ //from-remote/... //depot/externaltransfer/...

See the Helix Versioning Engine Administrator Guide: Fundamentals for more information.