Set a depot location for a single new file system

Move all depot data to a single new directory path or file system.

By default, the base directory for depot file storage for depots with relativeMap fields is the server root directory (P4ROOT). For example, if the P4ROOT is /p4/1/root, the depot files for the eng depot are located at /p4/1/root/eng/... (see line 6).

Copy
p4 -ztag depot -o eng
... Depot eng
... Date 2022/11/16 15:03:40
... Description Default depot
... Type local
... Map eng/...

Depot Map fields can also be specified as an absolute path (see line 7):

Copy
p4 -ztag depot -o system
... Depot system
... Owner sysop
... Date 2023/04/13 14:34:30
... Description Created by sysop.
... Type local
... Map /p4/depot_data/system/...

The server.depot.root configurable

The server.depot.root configurable is an alternative to the default of depot directory paths being relative to the P4ROOT directory. You can set this configurable to assign an absolute path, with respect to which a relative address given in the Map field of a depot form is evaluated. Setting the configurable takes effect immediately.

Absolute paths in the depot Map field are unaffected by the server.depot.root setting. Check all depot Map field settings by running p4 -ztag depotsbefore reconfiguring.

In multi-server environment with replica and edge servers, set server.depot.root so it only applies to those servers you want it to.

Any backup process must take the server.depot.root location into account and not assume depot files exist in the default P4ROOT location.

Changing the depot file directories

To change the depot file directories by using the server.depot.root configurable:

  1. Make a backup all depot directories.

  2. Prevent users from accessing the depots while moving them. Set protections to prevent write access by entering the p4 protect command:

    Add the following mappings at the end of the Protections field:

    list user * * -//...
    list group * * -//...
    super user usernameOfSuperUser * //...
  3. Get a list of all existing depots:

    p4 -ztag depots
  4. For each depot reported with a relative Map path, copy the depot directory from its existing location under P4ROOT to its new location under the chosen server.depot.root directory.

  5. Set the server.depot.root configurable. Isolate the server.depot.root setting to a specific server. To do that, the server must have a configured serverName. See p4 serverid in the P4 CLI Reference.

  6. Run the p4 verify -q //... command.