Reclaiming disk space by archiving files
Over time, Helix Server can accumulate many revisions of files. Some files might be from projects that are no longer active. Therefore, you might want to reclaim the disk space.
Archive depots are not a mechanism to back up files. Archive depots merely free up disk space by moving files that are rarely accessed to bulk storage. Archived files can be restored at any time. If you use p4 obliterate on certain files, their file data and history are permanently gone and those files can never be restored.
Compare the advantages of using an archive depot to the p4 delete and p4 obliterate commands:
p4 delete
|
p4 archive
|
p4 obliterate
|
---|---|---|
|
|
|
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
- Create a new depot with by using the
p4 depot
command, 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 the
p4 archive
command to transfer the files from a local depot to the archive depot. - (Optionally), unmount the volume to which the archive files were written.
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.