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:
  1. 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.
  2. Create a TAG from it in a version control system
  3. Keep doing changes in TRUNK, serialize changed items, commit them, etc.
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):

/source:F:\serialization1\
/target:F:\serialization2\
/output:C:\Package.update

Here's how the resulting package looks from within:


The module allows to use the full power of Sitecore serialization feature, that includes but not limited to:


  • No more manual packages - allows automated continuous deployment
  • Keep track of every single bit of content created by developers - use VCS to store items
  • Easily backup / rollback / revert items 
  • Only changed fields are packaged - extremely quick installation
  • Use rock-solid Sitecore feature. Some guys serialize gigabytes of data


Current feature set is just a proof of concept, the plans include:

  • Integration with Sitecore Rocks
  • Tools for Continuous Deployment 
  • and more! (let me know what you'd like to see)

So, download the module here (you might want to build exe runner from sources), share your feedback, and enjoy!