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:
- The Checker tool removes orphaned version histories.
- The VersionsCleaner updater script truncates version histories for existing documents.
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:
- In the CMS UI, open the updater execution panel.
- In the registry folder, find and open the
VersionsCleanerscript. - Set the
retainCountvariable to specify how many versions to keep per document. Set thedaysToKeepvariable to define the minimum age (in days) for versions to retain. - Save your changes to the script.
- 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:
- Download and configure the Checker Tool.
- In the
checker.propertiesfile, set thecleanvh.nonemptyproperty totrueorfalse:true: Remove orphaned version histories even if they are not empty.false: Remove only empty orphaned version histories.
- 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.