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.

Important

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

 

  • no disk space reclaimed

  • file history is preserved and "deleted" files can be restored

  • merely marks files as deleted at the head revision

  • disk space reclaimed on the storage used for your local depot

  • files moved to the archive storage

  • file history is preserved and archived files can be restored

  • disk space reclaimed

  • obliterated files cannot be restored

  • permanently removes file and its 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), use p4 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

  1. Create a new depot with by using the p4 depot command, and set the depot’s Type: to archive. Set the archive depot’s Map: to point to a filesystem for near-line or detachable storage.
  2. Mount the volume to which the archive depot is to store its files.
  3. Use the p4 archive command to transfer the files from a local depot to the archive depot.
  4. (Optionally), unmount the volume to which the archive files were written.

To restore files from an archive depot

  1. Mount the volume on which the archive depot’s files are stored.
  2. Use the p4 verify -A command to verify files before you restore them.
  3. Use p4 restore to transfer the files from the archive depot to a local depot.
  4. (Optionally), unmount the volume from which the archive files were restored.

To purge data from an archive depot

  1. Mount the volume on which the archive depot’s files are stored.
  2. 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.

  3. (Optionally), unmount the volume from which the archive files were purged.