The Version Manager module allows you to specify how many versions an item is allowed to have before making the oldest version obsolete by either deleting them through the application or set it up automatically. Version Manager allows users to keep only required amount of content item versions and archive obsolete ones.
Simply download and install the package for your Sitecore version. You will get:
- In the Sitecore->All aplications you will see the Version Manager application which lists all items in all languages that have more than defined in config file amount of versions and allows you to clean it up manually.
- In the App_Config/Include folder there will appear the Version Manager config file which will allow you to setup the module i.e. set the amount of versions to keep, enable/disable automatic cleanup, Content Editor warnings etc.
Notes:
- The Version Manager UI is available only for admin users by default.
- The archived versions will be placed in the [Data Folder]/serialization/VersionManager/[Year]/[Months]/[Day]/[Item Name {ID}] folder
The Version Manager uses the default Sitecore’s serialization logic but places the files in other folder structure. In order to restore some version you should just modify/replace the file generated by default Sitecore serialization and revert it:
- Open the Content Editor and select the item in the content tree
- In the Developer tab click on the “Serialize item” button in the Serialize chunk.
- Go to the serialized file on the file system (for instance “Home” item will be serialized like “[Data Folder]\serialization\master\sitecore\content\Home.item”)
- Now you have several options: * You can simply copy the proper file from under the Version Manager folder (for instance “[Data Folder]\serialization\VersionManager\2011\2\21\Home{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}\Versions_1-8.item”) rename it to “Home.item” and replace the file generated by Sitecore’s default serialization ([Data Folder]\serialization\master\sitecore\content\Home.item). Note: in this case the item will be restored in the same state as it was serialized i.e. all changes made after that serialization will be lost. * You can modify the Sitecore’s serialized file to add there versions you want to restore from the Version Manager archived items. If you will open the Home.item file you will see that it contains blocks for each version like:
----version----
language: en
version: 1
revision: 1b0dc1ed-b1c8-4bd1-9353-dd385e0989e5
…
----version----
language: en
version: 2
revision: cbb05750-27dd-4767-b150-bafc4b26f3b5
…
So just copy the required version data block from the Version Manager archived file to the Sitecore’s serialized file and save it. 5. In the Developer tab click on the “Revert item” button in the Serialize chunk.