Reclaiming disk space by archiving files
Over time, Helix server
accumulates many revisions of files from old projects that are no longer
in active use. Because p4 delete
merely marks files
as deleted in their head revisions, it cannot be used to free up disk
space on the server.
Archive depots are a solution to this problem. You use archive depots to
move infrequently-accessed files to bulk storage. To create one, mount a
suitable filesystem, and use the p4 archive
(and
related p4 restore
) commands to populate an archive
depot located on this storage.
Archive depots are not a backup mechanism.
Archive depots are merely a means by which you can free up diskspace
by reallocating infrequently-accessed files to bulk storage, as opposed
to p4 obliterate
, which removes file data and
history.
Archiving is restricted to files that meet all of the following criteria:
- By default, files must be stored in full (
+F
) or compressed (+C
) format. To archive text files (or other files stored as deltas), usep4 archive -t
, but be aware that the archiving of RCS deltas is computationally expensive. - Files must not be copied or branched from other revisions
- Files must not be copied or branched to other revisions
- Files must already exist in a local depot.
To create an archive depot and archive files to it:
- Create a new depot with
p4 depot
and set the depot’sType:
toarchive
. Set the archive depot’sMap:
to point to a filesystem for near-line or detachable storage. - Mount the volume to which the archive depot is to store its files.
- Use
p4 archive
to transfer the files from a local depot to the archive depot. - (Optionally), unmount the volume to which the archive files were written.
Disk space is freed up on the (presumably high-performance) storage used for your local depot, and users can no longer access the contents of the archived files, but all file history is preserved.
To restore files from an archive depot:
- Mount the volume on which the archive depot’s files are stored.
- Use the
p4 verify -A
command to verify files before you restore them. - Use
p4 restore
to transfer the files from the archive depot to a local depot. - (Optionally), unmount the volume from which the archive files were restored.
To purge data from an archive depot
- Mount the volume on which the archive depot’s files are stored.
-
Use
p4 archive -p
to purge the archives of the specified files in the archive depot.On completion, the action for affected revisions is set to
purge
, and the purged revisions can no longer be restored. The data is permanently lost. - (Optionally), unmount the volume from which the archive files were purged.