This is the second part of the How Compare For Kentico Works blog post series. Make sure that you read part 1 first befor reading this post. In this second post we skip by the how and why, and move right in to guts of using Compare for Kentico. We will also walk through how to use the tool to focus in on the differences that really matter.
Keep reading to find out how you can cut your deployment time, be more confident that the deployment actually worked, and keep some of your own sanity intact when it comes to moving changes from one environment to the next.
Using Compare for Kentico
You can see the main comparison screen for Compare for Kentico in the below screen shot. Let's start here when we begin the discussion on using the product. By the way, you should be able to click most of the following screen shots to see the larger, full sized version of the image.
When you compare your first project you will notice that there are three main categories of differences on the screen. If you are at all familiar with Red Gate's SQL Compare, there should not have be much of a learning curve here, as we used its user interface for inspiration. By the way, SQL Compare and SQL Data Compare are totally worth every penny, if you have not used it before I totally recommend it.
The first category of results are objects that exist in both sites, but are different. The list of objects includes, but is not limited to, any page template, web part, shared layout, transformation, query, class, C# code file, image file, database stored procedure, or custom database function can be compared using a "diff" style visualization.
The most astute of Kentico developers will notice that we are not using the Kentico unigrid to show each difference. We actually had to roll our own grid control. The reason for this is if you are comparing a site with thousands of objects, the grid worked, but it is a bit slow and uses ugly webform postbacks. We created our own client side grid that performs faster on actions like sort, change of a page, and filter. We feel it is much more user friendly because you spend less time waiting for the whole iframe to reload.
Clicking on the green view action button on a single result will display the comparison in detail. Differences are highlighted in red, green, or yellow depending on the type of modification to the object. Seeing this allows you to quickly identify if objects are not in sync. It is extremely helpful to see this when figuring out what to deploy, and even in troubleshooting live production errors. This is probably the most used portion of the tool.
The second category of results are differences or new objects that only exist on the source site. This grouping allows you to quickly identify any objects that you most likely need to push out to the target site. The most common scenario here is that the source site is your development instance or localhost version. And items that show up in this grid are indicators of new development that has not been pushed out. In the below screen shot I am missing 3 timezone updates on the target site.
The third category of results are differences or new objects that only exist on the target site. The screen shot below, with the red title indicates, what objects are missing on your source site. This grouping can get a bit tricky. The results normally indicate that an admin user or different developer has made modifications to your QA or Production site but not made that same change in development. This never happens right? This grouping also is one of the key ways that you can prevent yourself from overwriting or losing a change in production that does actually matter. We love this feature.
Get Right to What Matters
As you can see, there can be a ton of differences in a Kentico site. However, most of the time there are certain groups of objects or pages that you don't care if they are different. Think of things like form submissions, contact management and activity tracking data in EMS, social media insights, and customer addresses or orders in the e-commerce space. All of these data sources are not typically something you always want to have in sync. That is where our filters come in to play with Compare for Kentico.
Filters allow you easily select what types of objects you want to view in your comparison results. The top portion of the main compare screen allows you to control whether or not you want to view only database differences, or only code file differences, and much more. We used a customized object selector to be able to easily tag certain objects to either whitelist (fully include) or blacklist (fully exclude) in the comparison results. There are also a set of checkboxes like ignore last modified by date fields, and other Kentico nuances that tend to always be different, but don't technically matter if they are different.
As we have used the filters in different client projects, we have found that there always seems to be a reason to have the list of objects that you filter on to be slightly different. For this reason we added the ability to have custom compare settings per project inside of the tool. For one project you might choose to ignore all page aliases because you only want to know if the content tree structure is the same, for others you might be seriously interested in if all the page aliases are totally in sync. It is kind of a balance per site and per project that you can find by tweaking the filters. Once you have it configured the way you want, you save the custom settings, and re-use those same settings every time thereafter.
With utilizing the correct filters in your comparison project, you can reduce the number of differences from thousands to less than a hundred in a matter of seconds. Chances are, the less than one hundred differences are what really matter and filters let you do that on your project.
Part 3 of How Compare for Kentico Works is up next. In the third part of the series, we will go into more on the process that BizStream uses with the tool to help us save time on our deployments plus review the final output of the tool. Check back soon for more.