UIVersion and Partial Visual Upgrade

My current assignment is fairly simple, upgrade our department’s SharePoint 2007 environment to SharePoint 2010 by reducing as much as possible the impact on the end users. Now that may sound simple at first, but our clients just went through another upgrade less than a year and a half ago when we changed from SharePoint 2003 to 2007, and even if the interface stayed pretty much the same, lots of complaints and confusion were generated by this upgrade. As part of our 2010 upgrade, I made an executive decision to keep the 2007 layouts on the different sites and workspace. We are doing a db attach migration, meaning, that by default all existing sites and webs will keep their 2007 look. Now, I already hear people calling me names, and throwing virtual rocks at me. I know this is probably not the ideal situation, but I’m hoping this will be temporary, and that eventually our clients will be ready to make the move to the 21st century.

For your information, SharePoint 2010 ships with two master pages in the [14 Hive]/TEMPLATE/GLOBAL. The v4.master one represents the 2010 look, and the default.master the 2007 one. Every SPWeb object in the SharePoint API has a property exposed named UIVersion. This value can either be 3 or 4, and this is what determines what version of the master page the current web will be using. We have then modified our code so that every new web that gets created, automatically gets assigned with the UIVersion = 3.

As you have probably already guessed, keeping a master page from a previous generation of product is most likely to be created problems down the road. If you are ever planning on doing a migration and on keeping the 2007 look, know this, many new features offered by the 2010 version of the product will only be made available if you do a visual upgrade on your sites, meaning that you need to use the UIVersion = 4 before being able to leverage these new features. It is not enough to just upgrade the backend bits. One of these features is the edit in datasheet feature. Some of you may know that there exists a bug in the way the edit in datasheet feature works in SharePoint 2007. As described in my blog post found here, the edit in datasheet option of SharePoint 2007 doesn’t play well when trying to edit lists having multiple content types assigned to them. Keeping the UIVersion = 3 will still present this problem. However, as soon as you do a visual upgrade on your web, the problem goes away.

Here’s a simply PowerShell script excerpt I produced that allows you to revert a single web to the previous 2007 UI:

$web = get-spweb <url of web>

$web.UIVersion = 3


Visual upgrades are performed on an entire site collection at once. This option is available from the site collection settings page as shown in the following screenshot:

This may be good if you want to be able to convert everything to a 2010 look, but what if you want to do a gradual “Visual Upgrade” and upgrade each web one at a time? Well, that option is available to you out-of-the-box, but requires you to run 3 little lines of PowerShell code. The SPWeb object has a property named UIVersionConfigurationEnabled, that owhen set to true, allow you to do a visual upgrade that targets a single web within a site collection. The following PowerShell snippet shows you exactly how to do it:

$web = get-spweb <url of web>

$web.UIVersionConfigurationEnabled = $true;


Once the script has been executed, the option to do a Partial Visual Upgrade can be found under the Title, description, and icon menu. If SharePoint 2010 recognizes that the current web is using a previous version of the User Interface (UI), it will automatically add a new section at the bottom of the administrative page letting you to either upgrade to the new interface, or to previous what the current web would look like with the new interface:

This is an excellent tip for anyone who wants to gradually update their farm to use the 2010 interface, without converting Site Collections all at once. I know for my part, the “Preview the updated user interface” option will be very useful when time will come to present the users with what the new interface will look like, and hopefully get them to buy-in it.

Leave a Reply

Your email address will not be published. Required fields are marked *