Toggle menu

Manually Purging the Version History

In normal use, iCM manages your version history and retained versions for you. There should rarely be any need to follow the steps outlined in this article.
Note that there is now a scheduled task you can run to manually purge version history. The following article is for information only

As you submit articles, forms, media items and links - in fact anything that maintains version history - iCM automatically checks your version history policies and purges any older versions for you.

However, perhaps after making major changes to your version policies, you may want to refresh all of your version history in one hit, rather than waiting for changes to take effect as content is updated.

Manually Purging the Version History

Once items in your version history have been deleted there is no way of restoring them

To purge the version history manually:

  1. Log into iCM 
  2. Open a new browser window or tab and go to http://[yoursiteaddress]/icm/admin/indexversionhistory.cfm (this immediately carries out the purge, there are no other steps)

The number of versions and how long they should be kept is set by your version control policies in iCM. If none have been created then the settings in iCM's Autoconfig will be used.

If you have disabled version history by entering 0 for the "Number of versions" and "Retention periods" in autoconfig and there are no version control policies set up in iCM, this purge will delete all version history - you'll only have your current articles, media, forms etc left.

At the end of the report is a statement confirming that the process is complete and a summary of the total number of items deleted from the database.

The report includes the following information:

Policy CodeDescription
PLCYIDPolicy ID number, an automatically incrementing number assigned to each policy rule
ITMIDItem ID, the identity number of the item affected by the policy rule
ITYPThe type of item affected by the policy, article, media or link
VVersion number of the item in the database
DATEDate the version was created
POLICY DAYSThe retention period for the version policy
POLICY VERSIONSMinimum number of versions to be kept

Cleaning up Physical Media files

Prior to iCM 10.0.0.0, there were scenarios where the physical media files did not always get removed from the server even though they were no longer referenced by any iCM version history. This is not an issue with 10.0.0.0 onwards, but there is a script called moveunusedmedia.cfm in the icm\custom folder that can be run manually to perform this clean-up if needed. This will ensure that only the physical media files that are actually referenced by iCM are retained on the server.

This script will clean-up all media files no longer referenced by the iCM database. It's generally best to manually run the indexversionhistory.cfm script described above prior to cleaning-up unused media.

moveunusedmedia.cfm will clean-up (archive) all media files and directories, provided they are no longer referenced by the iCM database. It will not clean up based on the current iCM version policies, so indexversionhistory.cfm may also need calling.

For deleted media items, it is possible that version history will retain references to the physical media files, in which case the moveunusedmedia.cfm may not archive as many files as expected. If this is an issue, eg. if disk space needs to be freed, and losing version history for the deleted media items is acceptable, then there is a script called purgedeletedmediaitemversionhistory.cfm in icm\custom\utils that can be run to purge the old versions. This in turn should allow the moveunusedmedia.cfm script to archive more of the physical media files.

purgedeletedmediaitemversionhistory.cfm will purge any versions, just for deleted media items, that are older than a specified number of days. Specify a zero number of days to purge all versions. Once purged, these versions will no longer be available for viewing/restoring in iCM. As the media items have already been deleted, this should not be a problem, but it is something to be aware of.

Last modified on 15 July 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon