p4 unload
Unloads a workspace, label, or task stream to the unload depot or to a flat file.
Syntax
p4 [g-opts] unload [-f -L -p -z] [-c client | -l label | -s stream]
p4 [g-opts] unload [-f -L -z] [-a | -al | -ac] [-d date | -u user]
Description
Two uses for the p4 unload
command are:
| To transfer infrequently-used metadata from P4 Server db.* files to a set of flat files in the unload depot | To unload a client, label, or task stream to a flat file on the client |
|---|---|
|
P4 Server
reporting commands often retrieve a superset of
the desired data, and then users take advantage of automated or manual post-processing to
discard the irrelevant lines of output. For example, the Unloading metadata reduces the size of the working set required by P4 Server. On large sites with many years of historical metadata, unloading can offer significant performance improvements, reduce the output of the command-line queries and the amount of information displayed in applications like P4V P4 Server
commands such as To view
metadata that has been unloaded, use the |
This is useful for seeding a client into another database, or for creating a private backup of the client. The flat file uses the standard journal format. The client, label, or task stream remains fully loaded after the command is run. Requires the -o Option. |
Use the -c and -l options to unload a specific
client workspace or label. Users can only unload their own
workspaces or labels. Administrators can use the -f option
to unload workspaces and labels owned by other users.
You do not have to unload a workspace before you move it between commit and edge servers, because p4 reload -p automatically unloads the workspace from the source server before reloading it. Starting with 2026.2, when p4 reload -p runs the unload, it preserves exclusively opened and globally locked files and, from an edge server, promotes the non-promoted shelves of the workspace.
If you run p4 unload -c directly on a workspace that has files exclusively or globally opened, the command fails. Revert those files first, or use p4 reload -p to move the workspace between commit and edge servers. For the requirements and limitations, see p4 reload.
Use the -a, -al, or -ac options
to indicate that all specified labels and/or client workspaces are to be
unloaded. You cannot use these options if you are also using the
-o option.
Use the -d date and/or -u user
to restrict the unloading operation to labels and/or workspaces older
than a specific date, owned by a specific
user, or both.
Use the -L option to unload locked workspaces and/or
labels. By default, only unlocked labels or workspaces are unloaded.
The access date for a workspace is updated when:
- The workspace is used by a command that directly references the workspace. These commands include: p4 add, p4 change, p4 delete, p4 diff, p4 edit, p4 have, p4 integrate, p4 labelsync, p4 lock, p4 move, p4 opened, p4 reconcile, p4 reopen, p4 resolve, p4 revert, p4 shelve, p4 submit, p4 sync, p4 unshelve, and p4 where.
- The workspace is used in a revision specifier of the
form
@.workspace
Running p4 client doesn't update the access date. If you edit and save the client workspace specification, p4 client updates only the Update date of the workspace.
The access date for a label is updated when:
- the label is used by a command that directly references that label.
- the label is used in a revision specifier of the
form
@.labelname
By default, data in the unload depot is uncompressed. Use
-z to store it in compressed form. Unloaded metadata is
often highly compressible, particularly in continuous build environments
characterized by millions of build-associated workspaces labels that are
used to perform a single build and then rarely, if ever, accessed
again.
Options
| Option | Description |
|---|---|
|
|
Unload all applicable client workspaces and labels; requires
|
|
|
Unload client workspaces; requires |
|
|
Unload labels; requires |
|
|
Unload the specified client workspace’s metadata from
|
|
|
Unload metadata older than the specified date. |
|
|
Force option; administrators can unload workspaces, labels, and task streams owned by other users. |
|
|
Unload the specified label from |
|
|
Unload a |
|
|
Promote any non-promoted shelves belonging to the specified client that is being unloaded. The shelf is promoted to the commit server where it can be accessed by other edge servers. |
|
|
Unload the specified task stream. Note that the
|
|
|
Unload metadata owned by the specified user. |
|
|
Store the unloaded workspace, label, or task stream in compressed format. See also the lbr.unloaddepot.compress configurable. |
|
|
See Global options. |
Usage notes
| Can file arguments use revision specifier? | Can file arguments use revision range? | Minimal access level required |
|---|---|---|
|
No |
No |
|
- To unload a workspace or label, a user must be able to scan
all the files in the workspace’s have list The list of file revisions most recently synced from the depot into the workspace. In other words, the list of files that the client workspace has. and/or files tagged
by the label. Administrators should set
MaxScanRowsandMaxResultshigh enough (in thep4 groupform) that users do not need to ask for assistance withp4 unloadorp4 reloadoperations.
Related commands
|
To reload data from the unload depot. |