Thursday, November 15, 2018

Which Version of Sitecore Is This Again?

As someone working with multiple clients spanning various Sitecore versions, I often lose track of which versions of Sitecore I have installed 😑   Sometimes, I want to verify if an issue I've come across is a known issue in that version. Other times, I may be providing information about possible upgrade opportunities.

In any case, there are several approaches to identifying which version of Sitecore a site is using.

The Sitecore Shell

If you have access to the Sitecore shell, head to the Content Editor, click the System Menu button and select License Details.



If your Sitecore version is v 7.5 or lower, you can also find the version on the log in screen (update name not included):



Sitecore.Version.XML

Accessing /sitecore/shell/sitecore.version.xml is one of the easiest and quickest ways to find out version details - and it's always available on the CM server (Sitecore Knowledgebase: How to identify the Sitecore version and installed components)


Again, you're left on your own to find the update name yourself.

Sitecore.Kernel.dll

If you have access to the file system, you can navigate to the /bin folder, find the Sitecore.Kernel.dll and open the file's Properties.  Under the Details tab, the Sitecore Product Version will be visible here.



One caveat to this approach is that starting in Sitecore 8.2 (Initial Release), the product version listed in the Sitecore.Kernel.dll start with version 10.0.0.5597 - making it a little more difficult to quickly identify the Sitecore Product Version:

8 = 10.  Math.

Luckily, this Sitecore Stack Overflow Answer has the mappings you'll need.
Sitecore has provided additional information on their Versioning Policy page regarding their approach to product versioning.

Sitecore PowerShell Extensions

If you have access to the CMS and SPE is installed, running the $PSVersionTable command lists the Sitecore build version. Running $PSVersionTable.BuildVersion will display the Major, Minor, Build, and Revision numbers.  


This information is pulled directly from the Sitecore.Kernel.dll.
Referencing the previously mentioned Sitecore Stack Overflow Answer will give you the product's update name.  




Identifying Local Sitecore Versions with PowerShell

Initially, I wanted to come up with a way to identify every version of Sitecore I have installed on my local machine.  I used PowerShell (naturally)  to write a script that lists all installed Sitecore sites registered in IIS and their respective mapped update name based on an inspection of the Sitecore.Kernel.dll.

Here's the script:


Here's the result:

Listing all my local Sitecore instances with their respective 
With the release of the Sitecore Icon Search Chrome Extension, I was super happy with my experience building a Chrome extension - so I decided to give it another go and build the Sitecore Version Detector Chrome Extension.

That's right. The Sitecore Docs site runs on 7.2 Update-4.  Time for an upgrade? 
The extension is simple - built in pure HTML and Javascript - and checks two things:

Is the site using Sitecore? 

We can determine if a site is built on Sitecore by checking for the response on the site's /layouts/System/VisitorIdentification.aspx URL.  This file has been around since the days of DMS/OMS and is central to Sitecore's tracking mechanism. It's also always accessible from delivery servers!

If it's there, we can assume that the site is using Sitecore.

Which version of Sitecore is being used? 

Using the second method listed at the beginning of this post, the extension requests the current tab's /sitecore/shell/sitecore.version.xml URL for an XML response.  This file, while not always accessible on delivery servers, is often left exposed 💀

If it is accessible, we can parse the Major, Minor, Build and Revision values from the XML, then map to the appropriate update version name.

If a Sitecore version is detected, it will display the full revision (with the update name) and link to its respective http://sdn.sitecore.net or http://doc.sitecore.net version page.

The version's Mainstream Support End Date also displays below the version with a link to the Sitecore Product Lifecycle page 😏

Note: While this may often determine versions for live Sitecore sites (especially older versions of Sitecore), not all environments provide the means to determine the version of Sitecore it runs on as an end-user.  

Enjoy!