p4 archive
Archive obsolete revisions to an archive depot.
Syntax
p4 [g-opts] archive [-n -h -p -q -t -z] -D depot FileSpec[revSpec]
Description
This command enables a P4 Server user with admin access to transfer the specified revisions of versioned files into the archive depot A special depot into which versioned files (also known as archive files) can be transferred. on the master server, not replicas.
When files are moved into an archive depot, their last action is changed
      to archive.
Commands that access file content, such as p4 sync and p4 diff,  skip
      archive revisions. Commands that do not require access
      to file content, such as p4
	    filelog, continue to report metadata
      concerning the archived revisions.
 You can use p4 archive -n for testing purposes
	before mounting the file system associated with the archive depot.
	Storage for the archive depot must be mounted before running this
	command without the -n option. 
Task streams must be unloaded prior to the task stream file revisions being archived to an archive depot.
If you want to disable server
      locks when running the p4 archive command, set the value of the server.locks.archive configurable to 0.
Use with caution. The following commands permanently remove file data:
- p4 archive -p
- p4 obliterate -y
Criteria without -z
Without the -z option, the command archives only revisions that meet all four criteria:
- Stored in full (+F) or compressed (+C) format, rather than RCS format
- Located in a local depot (not a remoteor anotherarchivedepot)
- Not copied or branched from another revision
- Not copied or branched to another revision
Criteria with -z
With the -z option, the command archives only revisions that meet these two criteria:
- Stored in full (+F) or compressed (+C) format, rather than RCS format
- Located in a local depot (not a remoteor anotherarchivedepot)
which includes any files that have lazy copies A method used by P4 Server to make internal copies of files without duplicating file content in the depot. A lazy copy points to the original versioned file (depot file). Lazy copies minimize the consumption of disk space by storing references to the original file instead of making additional copies of the file. or are lazy copies.
Options
| 
 | Specify an archive depot to which files are to be archived. | 
| 
 | Do not archive head revisions. | 
| 
 | Do not archive revisions. Instead, report on which revisions would have been archived. | 
| 
 | For the specified files in the archive depot, remove the physical file revisions but retain the revision history with the latest action being set  to
	       File contents are no longer
	      accessible from  If you want to retain the metadata of purged files, do one of the following: 
 | 
| 
 | Quiet mode, which suppresses messages about skipped revisions. | 
| 
 | Archive text files (or other revisions stored in delta format,
	      such as files of type  | 
| -z | Includes any files that have lazy copies A method used by P4 Server to make internal copies of files without duplicating file content in the depot. A lazy copy points to the original versioned file (depot file). Lazy copies minimize the consumption of disk space by storing references to the original file instead of making additional copies of the file. or are lazy copies. See Criteria with -z. | 
| 
 | See Global options. | 
Usage notes
| Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required | 
|---|---|---|
| Yes | Yes | 
 | 
- To archive files stored in delta format, use the -toption.
- If a revision is stored in an archive depot, and the stored revision
	is accessible to the versioning service, a user can determine which archived revision to restore by using p4 print:p4 print -A -o myOutputFile //archive/depot/myFileThis command redirects all the versions of the archived file to myOutputFile. The user can then request that a P4 Server Administrator use p4 restoreto restore one or more versions of the file.A user with admin access can run p4 fstat -Ob to see the path, revision, type, full and relative local paths of the server archive file. 
There might be a computational cost associated with the manipulation of large numbers of RCS deltas.
Examples
| 
 | Archive revisions  If a single revision is specified as a file argument,  | 
| 
 | Archive revision  To archive only a single revision
	 | 
To archive files stored in delta format, use the -t
	option: 
| 
 | Use the  | 
| 
 | Use the  | 
| 
 | Use the  | 
There might be a computational cost associated with the manipulation of large numbers of RCS deltas.
Related commands
| To create a depot | |
| To restore files from an archive depot | |
| To obliterate files without archiving them |