Saving Site as Template Creates New Features?
-
21-01-2021 - |
Question
New to SharePoint. Working with a on-premise 2013 SharePoint system. Im trying to save a site as a template from Production and copying the resulting template WSP file into my DEV environment. There were no problems uploading and activating the WSP file in my DEV environment. But when I try to create a new sub-site with this template I get the following error saying:
The element of type 'ContentType' for feature 'PropertySite2018ListInstances' (id: d207df8e-248f-4e21-b634-e0563c3bb9d1) threw an exception during activation
I don't recall ever creating or installing any feature with this name. Using powershell, I confirm the feature does exist in my production:
But of course this does not exist in my DEV environment.
My question is, does "saving as template" cause these features to be created by SharePoint?
How do I copy these features into my DEV environment?
Solution 2
Answering my own question, I opened the WSP file with Visual Studio looked at the ONet.xml file which contains the feature ID and property:
<!--List Feature-->
<Feature ID="{d207df8e-248f-4e21-b634-e0563c3bb9d1}" Name="List Feature">
<Properties>
<Property Key="GeneratedBySaveAsTemplate" Value="1" />
</Properties>
</Feature>
<!--Module Feature-->
<Feature ID="{1e02f9fb-40ba-4c92-9a99-d61f6c35523e}" Name="Module Feature">
<Properties>
<Property Key="GeneratedBySaveAsTemplate" Value="1" />
</Properties>
</Feature>
<!--Web EventReceivers Feature-->
<Feature ID="{1ca694b7-6eef-4b63-8e93-1944fac6f47d}" Name="Web EventReceivers Feature">
<Properties>
<Property Key="GeneratedBySaveAsTemplate" Value="1" />
</Properties>
</Feature>
<!--CustomAction Feature-->
<Feature ID="{2e726362-745c-438c-8c22-d99aaba7a805}" Name="CustomAction Feature">
<Properties>
<Property Key="GeneratedBySaveAsTemplate" Value="1" />
</Properties>
</Feature>
<!--Property Bag Feature-->
<Feature ID="{01e82ebe-40e6-4176-b39e-da13f83180ff}" Name="Property Bag Feature">
<Properties>
<Property Key="GeneratedBySaveAsTemplate" Value="1" />
</Properties>
</Feature>
</WebFeatures>
Looking at the Key="GeneratedbySaveAsTemplate", I am guessing this clue indicates these features were some how created by SharePoint. I don't know the reason or how this works but I guess this is enough to answer this question.
OTHER TIPS
Try to use this, its available also to SharePoint 2013 https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine