Clean Up Version History

Overview

This page explains how to manage and reduce version history storage in the Bloomreach Content content repository.

When to Use

The content repository stores a version history for every document. Each time you publish a document, the repository saves a new version. Over time, this increases storage requirements.

You may need to clean up version histories to:

  • Remove orphaned version histories (where the original document no longer exists)
  • Limit the number of stored versions for existing documents

Tools for Version History Cleanup

Bloomreach Content provides two main tools for version history maintenance:

Truncate Version Histories for Existing Documents

Warning: The VersionsCleaner script always deletes versions, even in "dry run" mode.
This behavior follows the JCR 2.0 VersionManager specification, which applies changes immediately without requiring an explicit session save.

To limit the number of stored versions for each document:

  1. In the CMS UI, open the updater execution panel.
  2. In the registry folder, find and open the VersionsCleaner script.
  3. Set the retainCount variable to specify how many versions to keep per document. Set the daysToKeep variable to define the minimum age (in days) for versions to retain.
  4. Save your changes to the script.
  5. Click Execute to run the script.

Remove Orphaned Version Histories with the Checker Tool

When you delete a node from the repository, its version history can become orphaned if the node is permanently removed (for example, after clearing the attic). Orphaned version histories no longer have a corresponding document node and occupy unnecessary storage.

To identify and remove orphaned version histories:

  1. Download and configure the Checker Tool.
  2. In the checker.properties file, set the cleanvh.nonempty property to true or false:
    • true: Remove orphaned version histories even if they are not empty.
    • false: Remove only empty orphaned version histories.
  3. Run the cleanup command:
    java -jar hippo-addon-checker-<version>.jar cleanvh
    

If the tool cannot remove some orphaned version histories due to broken references, run a consistency check and fix with check.references=true. After resolving reference issues, rerun the cleanup.

You must also run a consistency check after any version history cleanup. The cleanup removes version histories from the version history table, but references between nodes and version histories remain in the reference table until explicitly fixed.

Note: MySQL's InnoDB storage engine does not automatically reclaim disk space. After running cleanup tools, perform an OPTIMIZE TABLE operation to reclaim storage.

Share Feedback
Page: /deploy/administration/maintenance/cleaning-up-version-history
Section: Deploy
Category *