Moving clients and labels
To move clients and labels between servers in a commit/edge environment, use the p4 unload and p4 reload commands.
Client Examples
The general form of the command to move a client between servers is:
p4 reload -c client -p P4PORT
p4 reload -c client -p serverID
where:
- P4PORT or
serverIDspecifies the server the client moves from - the server the p4 reload command is directed at specifies the server the client is moved to
- If a
serverIDis specified, the server specification for that server must contain the correctP4PORTvalue in itsAddressfield
The process is a single step with more recent versions of P4 server:
| 2014.2 and later | 2014.1 and earlier |
|---|---|
The preceding p4 reload commands implicitly run the p4 unload command against the server the client is being moved from before processing the reload. |
|
Move clients that have opened files, locks, and shelves
Starting with 2026.2, p4 reload -c client -p address moves a client together with its opened files, including files that are exclusively opened (+l file type) and files that are globally locked with p4 lock -g. You can move a client from the commit server to an edge server, from one edge server to another, or from an edge server to the commit server. In earlier releases, the command failed, and you had to revert the exclusively opened and globally locked files before you moved the client.
The exclusive lock stays in place on the commit server throughout the move, so no other user can lock the file while the client moves. When you move a client from an edge server, the server promotes the non-promoted shelves of the client to the commit server so that the shelves remain available after the move. Both servers must run 2026.2 or later.
The following limitations apply:
- Running
p4 unloadon its own still fails for a client that has exclusively or globally opened files. To move such a client, usep4 reload -c client -p address. - A standard server still refuses to unload a client that has exclusively or globally opened files.
p4 reload -c client -p addressstill fails for a client of a graph depot that has exclusively or globally opened files.- A lock that you take with
p4 lockwithout the-goption on the commit server is not carried to the destination server.
If the reload on the destination server fails after the client is unloaded from the source server, the client stays unloaded on the source server, and its locks are preserved. To recover, run the same p4 reload -c client -p address command again against the same source server.
User bruno moves client projectX_dev from a remote edge server to a local edge server:
p4 -p edge_local:1666 reload -c projectX_dev -p edge_remote:1666 Client projectX_dev unloaded. Client projectX_dev reloaded.
P4 Administrator admin moves client bruno_dev from the commit server to an edge server:
p4 -p edge:1666 reload -f -c bruno_dev -p commit:1666 Client bruno_dev unloaded. Client bruno_dev reloaded.
where the -f option for p4 reload is required for administrators to work with clients they don't own.
P4 Administrator admin moves client bruno_dev from the edge server to the commit server:
p4 -p commit:1666 reload -f -c bruno_dev -p edge:1666 Client bruno_dev unloaded. Client bruno_dev reloaded.
where:
- the
-foption forp4 reloadis required for administrators to work with clients they don't own - The commit server must have a configured service user
-
The service user must be logged in from the commit to the edge
Otherwise the following error occurs:
p4 -p commit:1666 reload -f -c bruno_dev -p edge:1666
Client bruno_dev unloaded.
Access for user 'remote' has not been enabled by 'p4 protect'.
Label Examples
For labels, both p4 unload and p4 reload are required.
User bruno moves global label bruno_hotFix from the commit server to an edge server.
p4 -p commit:1666 unload -l bruno_hotFix Label bruno_hotFix unloaded. p4 -p edge:1666 reload -l bruno_hotFix -p commit:1666 Label bruno_hotFix reloaded.
P4 Administrator admin moves global label from the commit server to an edge server:bruno_hotFix
p4 -u admin -p commit:1666 unload -f -l bruno_hotFix Label bruno_hotFix unloaded. p4 -u admin -pedge:1666reload -f -l bruno_hotFix -pcommit:1666Label bruno_hotFix reloaded.
where the -f option for p4 reload is required for administrators to work with clients they don't own.