Adding missing web parts with the PortalLayouts feature after SharePoint 2007 upgrade
Posted
Tuesday, January 25, 2011 4:36 PM
by
CoreyRoth
One thing I find annoying after attaching a SharePoint 2007 content database is that several of the new cool SharePoint 2010 web parts are simply not present on your upgraded site. This includes the new social web parts such as the Tag Cloud, Organization Browser, and Note Board. On an upgraded site, you may find that your Social Collaboration category looks like this:
I have talked about this in the past, but I’ve changed how I resolve the issue so I thought I would share a quick update. Before we begin, it’s a good idea to understand what has happened. In SharePoint 2007, you had site templates and they likely activated a feature called PortalLayouts. This feature still exists in SharePoint 2010, but it has changed. Specifically the file that we are interested in, webpartdwpfiles.xml, activates different web parts now.
Excuse me for the large display of XML here, but I think seeing it will make more sense. In SharePoint 2007, webpartdwpfiles.xml contained the following XML. Each File element installs a specific web part into the web parts gallery.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="WebPartPopulation" Url="_catalogs/wp" Path="dwp" RootWebOnly="TRUE">
<File Url="siteFramer.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,ContentRollupWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Miscellaneous;#" />
</File>
<File Url="owa.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,OutlookWebAccessWebPartGroup;"></Property>
</File>
<File Url="owainbox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,OutlookWebAccessWebPartGroup;"></Property>
</File>
<File Url="owacalendar.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,OutlookWebAccessWebPartGroup;"></Property>
</File>
<File Url="owatasks.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,OutlookWebAccessWebPartGroup;"></Property>
</File>
<File Url="owacontacts.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,OutlookWebAccessWebPartGroup;"></Property>
</File>
<File Url="contactwp.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MiscellaneousWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Miscellaneous;#" />
</File>
<File Url="AdvancedSearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="PeopleSearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchCoreResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchHighConfidence.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchsummary.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchstats.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchpaging.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="PeopleSearchCoreResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchBestBets.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchActionLinks.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="CategoryWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SiteDirectoryWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Site Directory;#" />
</File>
<File Url="CategoryResultsWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SiteDirectoryWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Site Directory;#" />
</File>
<File Url="TopSitesWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SiteDirectoryWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Site Directory;#" />
</File>
<File Url="ThisWeekInPictures.DWP" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,DefaultWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="TasksAndTools.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,DefaultWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="RssViewer.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,DefaultWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="TopAnswer.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SummaryResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
</Module>
</Elements>
Here is what the file looks like in SharePoint 2010.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="WebPartPopulation" Url="_catalogs/wp" Path="dwp" RootWebOnly="TRUE">
<File Url="siteFramer.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,ContentRollupWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Miscellaneous;#" />
</File>
<File Url="owa.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MyInformationWebPartGroup;"></Property>
</File>
<File Url="owainbox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MyInformationWebPartGroup;"></Property>
</File>
<File Url="owacalendar.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MyInformationWebPartGroup;"></Property>
</File>
<File Url="owatasks.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MyInformationWebPartGroup;"></Property>
</File>
<File Url="owacontacts.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:spscore,MyInformationWebPartGroup;"></Property>
</File>
<File Url="contactwp.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,PeopleWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Miscellaneous;#" />
</File>
<File Url="AdvancedSearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="PeopleSearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchBox.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchCoreResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchsummary.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchstats.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="searchpaging.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="PeopleSearchCoreResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchBestBets.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SearchActionLinks.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="TopAnswer.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="SummaryResults.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="Refinement.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="PeopleRefinement.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="QuerySuggestions.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
<File Url="CategoryWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,ContentRollupWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Site Directory;#" />
</File>
<File Url="CategoryResultsWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,ContentRollupWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Site Directory;#" />
</File>
<File Url="RssViewer.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,ContentRollupWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="TagCloud.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,PeopleWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="SocialComment.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,PeopleWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="ProfileBrowser.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:core,PeopleWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Default;#"/>
</File>
<File Url="DualChineseSearch.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="$Resources:Microsoft.Office.Server.Search,SearchWebPartGroup;"></Property>
<Property Name="QuickAddGroups" Value=";#Search;#" />
</File>
</Module>
</Elements>
If you look at some of the differences, you’ll notice that several web parts have been added in 2010, but several have also been removed. Web Parts that have been added include:
- Tag Cloud (TagCloud.dwp)
- Note Board (SocialComment.dwp)
- Organization Browser (ProfileBrowser.dwp)
- Dual Chinese Search (DualChineseSearch.dwp)
- Refinement Panel (Refinement.dwp)
- People Refinement Panel (PeopleRefinement.dwp)
Web Parts that have been removed in SharePoint 2010 include:
- This Week in Pictures (ThisWeekInPictures.dwp)
- Top Sites (TopSitesWebPart.webpart)
- I need to… (TaskAndTools.webpart)
When you do an upgrade, you’ll still have your removed web parts in the gallery. However, if you are on a new installation and want one of those old web parts, you’ll have to do a little work. From what I have read, you can export the .webpart or .dwp file of the web part and upload it to the solution gallery manually on your new server. It appears the underlying code is still present in the assemblies, just the web parts definitions have been removed from the web part gallery.
However, we’re interested in adding the new SharePoint 2010 web parts to the site collection’s web part gallery. You can manually upload them if you so choose. However, I’m not really a fan of that solution, but it will work in a pinch. Instead my solution now is to activate the PortalLayouts feature again. The feature is hidden, so your best bet to do this is with PowerShell. We do this with the Enable-SPFeature cmdlet. Since the feature was technically already activated in SharePoint 2007, we have to use the –force parameter. Here is the complete command for a root site located at http://sp2010.
Enable-SPFeature –Identity PortalLayouts –url http://sp2010 –force
If the command worked successfully, you should receive no errors and another command prompt. At this point, you can add your new web parts to an existing page. You should see three new ones in the Social section as shown.
I have not encountered any issues by reactivating this feature yet. It works for me and hopefully it works for you too. If you are missing web parts, try it out and see how it works for you.