Wednesday, October 3, 2012

Sitecore Courier - Effortless Packaging

The first question many Sitecore developers ask when they start thinking about deploying changes with Sitecore is – “How to track item changes?” The deal is - you cannot simply deploy the updated site from version control system (VCS), because production site also holds content items, being constantly edited by content editors, and you need to merge it.
The most straightforward (if not only) solution – is to use Package Designer, but… I want packages to be generated automatically, when I change the template, add a new field to the item, etc. – it is extremely hard to keep track of all these bits. And another important thing is field changes – if I change just __Presentation field – how do I deploy it to production without overwriting the other ones?

The solution is in the Sitecore.Update.dll, where you can find the code needed to generate “.update” packages. And you can do it automatically, by comparing serialized trees with the module I’ve just created and called Sitecore Courier.

The module can be installed as a Sitecore package, or used in build system with simple .exe runner.

Suggested usage workflow

After you deploy the initial version of your website to production, you should:

Serialize all items you want to move between the servers (usually, all custom items in Core and Master databases). Check the latest Serialization Guide here.

And packages will be generated automatically, by comparing serialization from TAG (source) to the TRUNK (target). Incremental package will contain only changed items.

Web Runner of the module should be mostly used for quick testing, here's the UI:

Web UI lets you analyze the differences between the folders and select the changes you want to include into the package.
And .exe runner can be used in your build system - it accepts 3 parameters (I've also added sample paths):