SharePoint 2013 Troubleshooting: MissingSiteDefinition V2V upgrade error
Problem
While performing a test-SPContentDatabase on a SharePoint 2010 content database that was restored to the backend of a SharePoint 2013 farm, discovered the following error in the upgrade report:
13 Sites in database [content database name] have reference(s) to a missing site definition, Id = [6215], Lcid = [1033], compatibility level = [14].
The MissingSiteDefinition error was non-upgradeblocking, so, proceeded with mounting this 2010 content database to 2013 web application and upgrading it. Upgrade completed successfully but with errors, one of which was the MissingSiteDefinition error. Then launched a site health check test. The resultant Site Collection Health Check Results report page listed 13 instances of Missing Site Template issues. These hade to be fixed or site upgrade would fail. Interestingly, in the Site Collection Health Checks Results report, these 13 instances did not contain the actual name of the template that was missing, only something like " - #0". Began troubleshooting.
Troubleshooting Steps
On the SharePoint 2010 farm, executed the following in an elevated DOS shell:
CD C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\
echo ^ > "D:\report.xml"
stsadm -o enumallwebs -databasename "[content database name]" -includefeatures -includewebparts -includeeventreceivers -includesetupfiles -includecustomlistview >> "D:\temp\report.xml"
Opened file in browser, and searched for "6215". Found 13 instances. Each instance was similar to the following:
-<Web Id="[web id]" TemplateId="6215" TemplateName="PWS#0" LanguageId="1033" Url="/[web url]">
Note in particular the template name and ID: PWS#0.
For one of the webs identified above, checked its source, searching for the g_wsaSiteTemplateId field, and verified the template ID and name as found previously.
Also executed these commandlets in an elevated SharePoint Management Shell to further verify template ID and name:
(Get-SPweb -Identity [web ID]).WebTemplate
(Get-SPweb -Identity [web ID]).WebTemplateId
Referring to SharePoint 2010 template listings, found that this template ID and name were associated with the Project Workspace site definition.
Compared the contents of
...\TEMPLATE\SiteTemplates\
on the SharePoint 2010 and 2013 farms (14 and 15 hives), found the PWS folder in
...\14\TEMPLATE\SiteTemplates\
but not in
...\15\TEMPLATE\SiteTemplates\
Also noted that Microsoft Project was deployed and integrated with our SharePoint 2010 farm but not with our 2013 farm.
Copied entire PWS folder from
...\14\TEMPLATE\SiteTemplates\
on SharePoint 2010 farm to
...\14\TEMPLATE\SiteTemplates\ and
...\15\TEMPLATE\SiteTemplates\
on the SharePoint 2013 farm, and then re-executed the Site Collection Health Check, but the 13 Missing Site Template errors still appear in report. One minor change I noted was that, previously.
Compared the contents of
...14\TEMPLATE\1033\XML\
on the SharePoint 2010 and 2013 farms and found this file
webtemppwa.xml
in SharePoint 2010 but not in SharePoint 2013.
Viewing the contents of this file, found an entry referring to "PWS:"
<Template ID="6215" SetupPath="SiteTemplates\PWS" Name="PWS">
Copied this file from production SharePoint 2010
[SP2010P]\C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\
to development 2013
[SP2013D]\C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\
ensuring that it is in the same 14 file have on both.
Re-executed the Site Collection Health Check, this time, the 13 missing site template errors appear as " - PWS#0".
Copied this file from production SharePoint 2010
[SP2010P]\C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\
to development 2013
[SP2013D]\C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\1033\XML\
ensuring that this time the file is copied to the 15 file hive in the SharePoint 2013 development farm.
Re-executed the Site Collection Health Check. No upgrade-blocking issues appear.
Solution
- When "Missing Site Template" errors appearing the Site Collection Health Check Results report, determine the name of the template that is missing, and then copy it from appropriate file hive on the source 2010 farm to both the 14 and 15 file hives in the destination 2013 farm.
References
- SharePoint 2010 TEMPLATE directory
- What is the difference between site template and site definition?
- RESOLVE “MISSING SITE TEMPLATES SHAREPOINT 2013 UPGRADE ERROR
- Scripted deployment reference (SharePoint Foundation 2010)
- Migrating PS 2010 to PS 2013 Walkthrough
- Upgrade from SP 2007 to SP 2013 - Missing template (PWS) issue
- How to find the SharePoint Site Template being Used
- Upgrading your Content DB to SharePoint 2010 – Part 1, The preupgradecheck
- Helpdesk Template in 2013?:
- SharePoint 2010 How do you work out what type of site a site it?
- Creating, deploying and updating custom site definitions
- Resolving Missing References when upgrading to SharePoint 2010
- SharePoint 2010 Missing Site Definition Error
- Finding what site definition is used by a SharePoint site
Notes
Site templates are stored in this location:
[root]:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12,14,15,16]\TEMPLATE\SiteTemplates\
These efforts were part of an overall V2V upgrade process from SharePoint 2010 to SharePoint 2016.