ÃÛ¶¹ÊÓƵ

Configuring version purge parameters to avoid erasing all versions in AEM

The OSGi parameters that must be configured for version purging in ÃÛ¶¹ÊÓƵ Experience Manager (AEM) are Maximum number of versions, Minimum Number of versions, and Maximum version age. This article discusses the correct configurations of these parameters across different use cases to help you avoid erasing all versions of a page.

Description description

Environment

ÃÛ¶¹ÊÓƵ Experience Manager (AEM)

Issue/Symptoms

Setting version purge OSGi parameters incorrectly erases all versions of a page.

For instance, you wanted to retain 10 versions regardless of age and set the parameters as below:

maxAgeDays= -1
minNumberVersions= 0
maxNumberVersions= 10

However, this erased all versions instead of retaining the 10 as specified.

Resolution resolution

The correct parameter configuration to retain 10 versions should have been as follows:

maxAgeDays= -1
minNumberVersions= 10
maxNumberVersions= 0 (maxNumberVersions is irrelevant here if you want 10 versions irrespective of age).

Cause

When the age limit (maxAgeDays) is set, the minNumberVersions and maxNumberVersions parameters are crucial to limit the lower/upper bound.

If the age is set to 0 or -1 and no minNumberVersions is set, all versions are removed. Therefore, if you wish to retain any number of versions, ensure that minNumberVersions is always set to greater than 1, regardless of age.

Note: The current version is always retained.

Use Cases

Here are a few use cases to review before configuring your OSGi parameters to avoid purging all versions of a page.

minNumberVersions
maxAgeDays
maxNumberVersions
Result
0
-1
10
Even if there are 10 versions older than 1 day, this configuration purges all versions.

This is because minNumberVersions is set to 0 (or less than 1), indicating that all versions should be purged. The maxNumberVersions parameter becomes irrelevant when no age limit is set).
0
10
10
If all versions are older than 10 days and the minNumberVersions parameter is not specified, all versions are purged because none are within the 10-day limit.

If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0, five versions are retained.
0
10
0
If all versions are older than 10, all versions are purged because there is no minimum number of versions to be retained. And there is no maxNumberVersions in this case either. Even if there were 5 versions less than 10 days, all versions would be purged.
-1
-1
10
This setting purges all versions because there is no minimum number of versions to be retained. The maxNumberVersions parameter becomes irrelevant when no age limit is set.
-1
10
10
If all versions are older than 10 days, all versions are purged because there is no minimum number of versions to be retained. The maxNumberVersions parameter becomes irrelevant when there are no versions less than or equal to 10 days.

If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0, only the 5 versions lesser than 10 days are retained.
-1
10
0
If all versions are older than 10 days, all versions are purged because there is no minimum number of versions to be retained. The maxNumberVersions parameter is irrelevant in this case.

If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0, then 5 versions are retained.
5
10
5
If all 5 versions are older than 10 days, all 5 versions are retained because minNumberVersions is set to 5.

If there are 25 versions older than 10 days, only the last 5 versions are retained because both min and max are set to 5.
5
10
10
If there are 5 versions within 10 days and 10 versions older than 10 days (total 15 versions), the last 10 versions are retained because minNumberVersions is set to 5 and maxNumberVersions is set to 10. Here, both min and max parameters are important.

Version Purging

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f