Over time, document versions can accumulate significantly. For example, each publish action creates a new version. Without intervention, this can eventually lead to millions of unnecessary versions. To address this, the Version Store schedules a cleanup job, triggered by a cron expression, to remove excess versions. This process is referred to as version decluttering. For details on available settings, see Configuring the Sophora Server.
A version is considered obsolete if one of the following conditions is met:
- The number of versions per document is exceeded.
- The maximum age of a version is exceeded.
In order to configure when these conditions are met, you can set different properties globally, on a node type level and per document:
Properties to set globally and per node type
sophora.versionstore.maxVersionsToKeeporsophora.versionstore.byNodeType.[label].maxVersionsToKeepsophora.versionstore.maxVersionAgeInDaysorsophora.versionstore.byNodeType.[label].maxVersionAgeInDays
Properties to set per document
sophora:maxVersionsToKeep: this overwrites the globally/per node type set maxVersionsToKeepsophora:minVersionsToKeep: if this property is not set the default of 15 will be used
Interaction
- If the minimum as well as the maximum versions to keep are configured in a document, there may be less than the configured mininum number of versions if
sophora:maxVersionsToKeepis set lower thansophora:minVersionsToKeep. - If the global or node type level
maxVersionsToKeepis greater than 15 and you have not configuredsophora:minVersionsToKeepfor a specific document, there may remain at least 15 versions of that document even if these are older than the configured maximum age. - If
sophora:minVersionsToKeepis configured for a document, it may take precedence over global or node type levelsophora:maxVersionsToKeep.
Examples for the interactions:
Assuming there are 30 versions of a specific story document in total, each of them older than 1 day.
- Interaction 1: the properties are defined as
sophora:minVersionsToKeep=20sophora:maxVersionsToKeep=15sophora.versionstore.byNodeType.story.maxVersionAgeInDays=1
--> With this configuration, after decluttering, there will be 15 versions left since sophora:maxVersionsToKeep is set on document level and is lower than sophora:minVersionsToKeep.
- Interaction 2: the properties are defined as
sophora.versionstore.byNodeType.story.maxVersionAgeInDays=1
sophora.versionstore.byNodeType.story.maxVersionsToKeep=20.
--> With this configuration, after decluttering, there will be 15 versions left since minVersionsToKeep was not set to overwrite the default of 15 on this specific document.
- Interaction 3: the properties are defined as
sophora:minVersionsToKeep=20sophora.versionstore.byNodeType.story.maxVersionAgeInDays=1
sophora.versionstore.byNodeType.story.maxVersionsToKeep=10.
--> With this configuration, after decluttering, there will be 20 versions left since maxVersionsToKeep was not set on a document level for this specific story.