Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andrew shearer 501 posts 647 karma points
    Oct 20, 2022 @ 02:50
    andrew shearer
    0

    Content Version Cleanup "KeepLatestVersionPerDayForDays" setting

    hello - forgive me but I'm struggling a bit to understand the name and wording of this setting.

    https://our.umbraco.com/Documentation/Fundamentals/Data/Content-Version-Cleanup/ describes it as:

    The default cleanup policy is to remove all versions that are more than 4 days old except for the latest version which will be kept for 90 days.

    So what does that mean happens with the latest version after 90 days - does it disappear? Does 'latest version' mean the published version in this context?

    thanks

  • Marc Goodson 2097 posts 13921 karma points MVP 8x c-trib
    Oct 20, 2022 @ 06:16
    Marc Goodson
    0

    Hi Andrew

    Super confusing naming of the options!

    Ironically a better explanation here in the docs:

    https://our.umbraco.com/documentation/Reference/Configuration/ContentSettings/#contentversioncleanuppolicy

    The implementation in code is here:

    https://github.com/umbraco/Umbraco-CMS/blob/e626fca2432582f052cb13654eedd9e60ef8723f/src/Umbraco.Core/Services/DefaultContentVersionCleanupPolicy.cs#L47

    Essentially if I read correctly every version of a content item is looped through and its 'TotalDays' is calculated - which is the number of days since it was created until the current date.

    The first check is if cleanup is prevented for the individual version, there is UX in the backoffice to set a version as 'prevent cleanup'

    then it checks if the version was created more recently that the 'KeepAllVersionsNewerThanDays' setting

    So if that's set to 7 days, and you created the version the day before yesterday, it stays!

    But if it wasn't created 'recently' based on that logic then we move onto the next test

    Which is to consider 'is it old' is it created 'after' the 'KeepLatestVersionPerDayForDays' setting.

    If so then it's fair game to be deleted

    If it's not, and it's somewhere between the two settings, then it's not completely safe! - Umbraco will check all the versions created on a specific date and delete all of them except the latest one that was saved!

    (and now the naming starts to make sense, 'KeepAllVersions' or 'KeepLatestVersionPerDay')

    So if that is set to 30 days, every version more than a month old, would be added to the 'content version clean up list'....

    every version less than 30 days but greater than 7 days (with our other setting above) would be added to a list of possible deletes, and they are sorted by date, and the last save on a day is 'saved' from deletion)

    So that's what the 90 days figure is, it's the length of period that the 'don't keep all versions, but do keep the last one that was saved for a content item on a particular day' runs for!

    regards

    Marc

  • andrew shearer 501 posts 647 karma points
    Oct 25, 2022 @ 19:33
    andrew shearer
    0

    Hi Marc - sorry for the slow reply but thanks for the detailed response! Glad I'm not the only one finding it hard to follow the naming.

    I suspect youre right in your summation and explanation, and I assume its a majority use-case to need to configure a clean up policy with these two settings in combination like this. For our purposes though, a simple "Keep historic versions for X days" and/or "Keep x number of historic versions" wouldve sufficed and be very simple to understand and explain to content editors.

    With how the official docs refer to the 'most recent version', 'current draft' and 'currently published' content, its very ambiguous to me if the clean up policy can in fact apply to the published content or not. To my way of thinking the clean up policy config and documentation should make it clearer that it strictly applies to historic versions only.

    thanks

    Andrew

  • Marc Goodson 2097 posts 13921 karma points MVP 8x c-trib
    Oct 25, 2022 @ 21:05
    Marc Goodson
    0

    Hi Andrew

    Yes, agree, it's a little bizarre, I guess it's trying to be all things for all scenarios and not focusing on the common use case you describe...

    After you raised it I put a PR into the documentation for the page you referenced as being unclear...

    https://our.umbraco.com/Documentation/Fundamentals/Data/Content-Version-Cleanup/

    Based on what we found out here...

    Have I made the explanation any clearer to how it was before? or is it a bit of a lost cause?

    Regards

    Marc

  • andrew shearer 501 posts 647 karma points
    Oct 28, 2022 @ 01:46
    andrew shearer
    0

    I think that documentation is clearer to understand now - thanks Marc :)

    Also, I'm bemused why the Cleanup policy only applies to content versions (i.e. what you see when clicking on the Rollback button) and not what you see on the History tab itself. They are one in the same to Joe normal content editor so i don't understand the distinction/separation being made.

    In other words, if i define a clean up policy to toast rollback versions older than 6 months (180 days) for a CMS thats 4 years old, why can i still see the full 4 years of history?

    Just my thoughts anyway.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    15 days ago
    Nicholas Westby
    0

    if i define a clean up policy to toast rollback versions older than 6 months (180 days) for a CMS thats 4 years old, why can i still see the full 4 years of history?

    My guess would be for auditing purposes. So, the contents of each version get cleaned up to save on database space (and maybe speed up some things), but the history of changes (at a high level) is still kept in case people wonder things like "who has contributed content to this page" or "who changed this page before the most recent edit that I made".

Please Sign in or register to post replies

Write your reply to:

Draft