CoreContentOnly

Keep Latest N Revisions

Oct 08, 2008

There are often a wide variety of reasons why someone may want to keep only the latest n revisions of content in their content server. These reasons range all over from keeping disk usage in check to a form of security/retention management. Whatever your reason the process is pretty straight forward. I am going to show you how to setup archiver to take out all but the latest X revisions. In a later post we can talk about various ways to enact that archive on a scheduled basis.

So, simply put, the secret to this is the Revision Rank (dRevRank) field. A lot of times in the past I've tried looking at dRevLabel, dID, dDocID, but nope, the special field you want is Revision Rank. Use the following steps to set up your archive:

  1. Log onto your content server as a user with administration rights
  2. Under "Administration" select "Admin Applets" and then fire up the Archiver applet
  3. From the "Edit" menu select "Add"
  4. Give your archive some kind of meaningful name
  5. Provide a description, perhaps include something about the expected lifetime of this archive?
  6. Click "OK"
  7. Select the new archive in the archive list and then click on the "Export Data" tab
  8. From the Export Query section select "Edit"
  9. Set the following field defintions
    • field to "Revision Rank"
    • Set the Operator to "Is Greater Than"
    • Set the value to "4"
  10. Click "Add", add and then "OK"
  11. Under "Actions" click on "Export"

Great, now lets discuss some of these points. The Revision Rank field is zero based (meaning it starts at zero) and that zero represents the most recent revision of the content in question. The second most recent revision is denoted by a dRevRank of 1, etc. For example, if you wanted to delete everything but the 5 latest revisions you should set dRevRank to 4. If you wanted to only keep the most recent revsion set dRevRank to 0.

Upon selecting "Export" you will be prompted deleting the revisions from content server during the export process. If you place a check mark in the check box the content will be REMOVED from content server. The content will continue to exist in the archive you just exported as long as you don't crack that open and delete it in there as well.

© 2019 Jason Stortz