Perforce Public Knowledge Base - Moving workspaces in a Distributed Perforce environment
Perforce Software logo
Reset Search
 

 

Article

Moving workspaces in a Distributed Perforce environment

« Go Back

Information

 
Problem
How do I move client workspaces between servers in a Distributed Perforce environment?
Solution
Moving client workspaces between servers in a Distributed Perforce environment can be accomplished using the p4 unload and p4 reload commands. 

Before the unload and reload commands can be used against a workspace, client workspace owners must first submit or revert any promoted shelves or exclusively locked (+l) files. Otherwise, clients with all other types of opened files can be unloaded and reloaded.

Beginning with the 2014.2 Perforce Server release, the unload command is no longer required as a separate step for moving client workspaces between Edge or Workspace servers, provided the -p flag is specified when using p4 reload. In the 2014.2 release, the unload step was bundled into the reload command, as noted in the release notes:
 
	#777628 **
	    When using 'p4 reload -c <client> -p <port>' to migrate your
	    unlocked workspace from one Edge Server to another, it is no
	    longer necessary to first issue the 'p4 unload -c <client>'
	    command to the remote Edge Server. The reload command will
	    automatically issue the 'p4 unload' command for you, and will
	    wait for it to complete, prior to reloading your workspace into
	    the new Edge Server.


2014.1 and earlier Perforce Servers

Prior to 2014.2, the process for moving a client workspace from a remote edge server was to first unload and then reload the workspace. For example:
  1. Unload the workspace from the source server:
    p4 -p SOURCE-P4PORT unload -c WKSP-NAME
    
    
  2. Reload the workspace on the target server:
    p4 -p TARGET-P4PORT reload -c WKSP-NAME -p SOURCE-P4PORT

Examples

In the examples below, the commit server runs on commit:1666 and the edge servers run on edge:2000 and edge2:2002.
 
Example 1
User bruno wants to move client workspace bruno_dev from the commit server to an edge server. 
p4 -p commit:1666 unload -c bruno_dev
Client bruno_dev unloaded.

p4 -p edge:2000 reload -c bruno_dev -p commit:1666
Client bruno_dev reloaded.

Example 2:
Perforce Administrator admin wants to move client workspace bruno_dev from the commit server to an edge server. Note the -f flag for p4 unload and p4 reload is required for the administrator to work with workspaces they don't own:
 
p4 -u admin -p commit:1666 unload -f -c bruno_dev
Client bruno_dev unloaded.

p4 -u admin -p edge:2000 reload -f -c bruno_dev -p commit:1666
Client bruno_dev reloaded.
 
Example 3: (requires 2014.2+ version Perforce Server)
User bruno wants to move client workspace projectX_dev from a remote edge server (edge2) to his local edge server (edge). 
 
p4 -p edge:2000 reload -c projectX_dev -p edge2:2002
Client bruno_dev reloaded.

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255