During a recent migration attempt from SharePoint 2007 to SharePoint 2010 I ran into the following error in the upgrade log during the database attach upgrade process:
Exception: Attempted to perform an unauthorized operation. at Microsoft.SharePoint.SPSite.set_AllowMasterPageEditing(Boolean value)
at Microsoft.SharePoint.Portal.Upgrade.AllowMasterPageEditingAction.Upgrade(SPSite site)
This really didn’t make much sense at first because I was running the PowerShell command to attach/upgrade the database using a farm administrator account. It had to be a permissions issue, but what was causing it? I tried running PowerShell under a couple different accounts, all coming back with the same exact error.
I remembered one key thing I had done; I disabled the ability for users to detach pages from site definitions and disabled site collection administrators from being able to modify master pages and page layouts using SharePoint designer. I went back into central administration and enabled those functions and tried restarting the upgrade using the PowerShell command Upgrade-SPContentDatabase. This time it completed successfully with no errors.
To change SharePoint Designer permissions:
- Open SharePoint 2010 Central Administration
- Choose Manage Web Applications
- Select your web application and then click on the General Settings drop down in the ribbon bar
- Choose SharePoint Designer
- Modify the settings as appropriate and then click ok.