How to Change UI Version of SharePoint 2010 Web Application

Once, I was involved with migration (in-place) of WSS sites to SharePoint 2010 environment. In WSS environment, we have custom site definitions and master pages.

Migration was done successfully as per steps provided by Mircosoft. But i faced few issues in newly created subsites. detailed as below:

whenever user creates a new sub site (using custom site definitions) in migrated SharePoint 2010 environment, he/she finds that newly created sub site is totally distorted. It shows dialog boxes (which are disabled itself, so doesn’t allow to perform) for adding/updating items or creating new list/site etc.. It does not allow to add web part on page using browser and also mercer theme is applied.

Now this is the time to see solution:

1. Open Management Shell as administrator
2. Run following commands to update UIVersion of sub site (keep handy subsite web URL)
$web = Get-SPWeb http://servername:80/sitename/subsitetitle
$web.UIVersion=3
$web.UIVersionConfigurationEnabled = $true
$web.Update()




3.  Then, run following command to update master page as same as root web
$rootweb = Get-SPWeb http://servername:80/sitename
$web = Get-SPWeb http://servername:80/sitename/subsitetitle
$web.CustomMasterUrl = $rootweb.CustomMasterUrl
$web.MasterUrl = $rootweb.MasterUrl
$web.Update()

Actually, what was happening?
When user creates new sub site, SharePoint  parses our custom site definition and associates master pages with newly created sub site.

Because



  1. Master pages were referring CSS file on wrong location, hence original theme was not applied.
  2. Sub site was created in SharePoint 2010 environment, hence it’s UI version was automatically set to 4 (For backward compatibility, SharePoint 2010 provides a new property to SPWeb class as UIVersion, value should be 3 for WSS/MOSS2007 and 4 for SharePoint 2010), which was causing new sub site to behave in mixed mode WSS and SharePoint 2010 (i.e. dialog boxes (which are disabled itself, so doesn’t allow to perform) for adding/updating items or creating new list/site etc. and not allowing to add web part on page using browser). As UIversion was valued as 4, sub site was expecting ribbon in master page to add web part on site page, which was not available in our migrated master pages.

Hence, I did following actions, whenever new site is created, SharePoint:

  • Sets new sub site’s UI version to 3
  • Sets correct rootweb’s master page URL to new sub site.




Be Connected…

Satyendra

,

Leave a Reply

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