Sitecore Blog: @sitecorejohn blog

Thoughts on Versioning Items with the Sitecore ASP.NET CMS

By John West, July 12, 2013 | Rating:  | Comments (3)

This blog post provides some guidance on managing versions of items with the Sitecore ASP.NET web Content Management System (CMS).

This post is about versioning content items. Code (including CSS, JavaScript, images, other media, and anything else referenced directly by code rather than determined dynamically by code at runtime), the assemblies generated from source code, and anything else maintained by developers should follow a standard source code management and release process completely separate from but in some cases synchronized with the deployment of content. Developer components include data templates, which Sitecore maintains as items, but should follow code release practices. For such resources I highly recommend the Team Development for Sitecore (TDS) product by Sitecore technology partner Hedgehog development.

The Sitecore default configuration and general recommendation is that each version relates to a complete workflow cycle. To summarize, when a user creates an item, Sitecore creates a version in the current content language and initiates the workflow for that version. After that item completes its workflow, if a user edits the item in that language, Sitecore creates a new version and initiates its workflow. In some cases when working as a Sitecore administrator, Sitecore does not create new versions or initiate workflows.

This process can repeat indefinitely, resulting in a theoretically infinite number of versions. Practically, you should limit the number of versions in any language, typically by removing old or irrelevant versions (for example, versions that differ from other versions by only a few typos). There are no specific rules here, but I would suggest 10 or 30 versions as a general rule of thumb. Another approach would be to prune versions older than some number of days, or some combination (keep versions newer than some number of days unless the number of versions exceeds a given number). Versions are not intended for audit, for which Sitecore provides other facilities. If you choose to trim versions, you may wish to first serialize the items so that you have another copy of the data beyond that provided by your relational database backups.

Users can also create versions manually, which means that more than one version of an item in a single language can go through workflow concurrently. Sitecore always publishes the highest version number for which there are no publishing restrictions, including workflow state. To create a new version in the Content Editor, select the item and language, select the Versions tab, and then click Add in the Versions group. Other commands on this tab let you work with other versions and languages, including visual comparison of the differences between versions and manual translation of one language to another.

Some organizations may choose to implement a workflow action or other solution to create a new version each time content moves from one workflow state to another, or from specific workflow states to other specific workflow states. In this case, the action may set publishing restrictions to prevent publication of the previous unapproved versions, and update the workflow state associated with those versions to prevent them from appearing in the workbox. Another workflow action or other process could remove those intermediary versions when the workflow completes, leaving only the published versions. Otherwise, this would lead to a higher number of versions, in which case pruning versions would be more important. An even more version-intensive approach would be to create a new version each time a user unlocks an item, or even more intensively, each time a user saves an item. This provides the most detailed version trail, but could lead to a very large number of versions.

In the Content Management (CM) environment, the number of versions of an item in a single language can affect usability, and the number of versions in all languages can affect performance.

In my experience, users rarely revert to a previous version. If they do, they revert to the previous version, not an earlier version. To achieve this goal in Sitecore, simply delete the current version (in the Content Editor, select the appropriate item, language, and version, click the Versions tab, and then click Remove in the Versions group). More often, they remake changes, possibly by cutting and pasting from a previous version. I think that even developers rarely revert to previous versions, other than discarding their most recent changes.

If you have any additional insight about version management with Sitecore, or simply to indicate your versioning strategy or the number of versions you choose to maintain, please comment on this blog post.


Tags: Architecture, Infrastructure


  • Hi John,

    You said "Versions are not intended for audit, for which Sitecore provides other facilities". What are you referring to exactly?

    I would generally agree with your comments about versioning in that it is rarely used. Having said that, I know that a content editor can be annoyed when they forget to manually add a version and have to manually re-write something. Either because of an error, or simply a temporary change. Fortunately, it is a rare occurrence.

    - Jonathan Hyatt
    July 23, 2013 at 9:11 AM

  • @Jonathan: By default, you get some audit in the Sitecore logs, which I think you can configure to write separately from the system logs. For some types of reporting, you can use components such as this:

    Remember your database backups. You can implement workflow actions, lock/save/unlock event handlers, UI customizations, and/or other features such as a custom database for reports. You might want to look at some of the lock configuration settings, which I have never changed. There are other relevant features that I have not explored, such as the history engine.

    - John West
    July 23, 2013 at 9:47 AM


    - John West
    October 23, 2013 at 4:18 PM

*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.

Enter your email address to see subscription options or manage your existing account

LifeScript | Read Case Study >

Sitecore has been a huge win in terms of cost and time savings, and will take us well into the future as a top site for women’s health.

- Jack Hogan, COO, LifeScript