Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you try to use an existing site template to create a new SharePoint Server 2007 site: "Failed to apply template"


View products that this article applies to.

Symptoms

Consider the following scenario:

You make changes to an existing SharePoint site and save the updated site as a template. Then, you try to use this template to create a new SharePoint site.

In this scenario, when you click Save Site as Template under Look and Feel on the Site Settings page, you receive the following error message:

Failed to apply template TemplateName.stp to web at URL
SharePointSiteName, error The template you have chosen is invalid or cannot be found.

Additionally, the template is not saved.

↑ Back to the top


Cause

This issue occurs if the top-level site of the SharePoint site that you are trying to save as a template has publishing features turned on. In this case, Save Site as Template appears under Look and Feel on the Site Settings page.

Note: In order to prevent the use of the Save site as template feature for creating new sites, you must disable the Save site as template feature. However, if the top-level site has the publishing feature turned on, the option to turn off the Save Site as Template feature is disabled when you try to create a new site. This behavior also occurs in SharePoint Designer.

The supported method to create templates for publishing sites is to use site definition templates. For more information, visit the following Microsoft Web site:

Site Types: WebTemplates and Site Definitions

↑ Back to the top


Workaround

To work around this issue, open the Feature.xml file of the Publishing feature in a text editor. This file is located under <Drive:>\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\Publishing folder on the SharePoint server

where

<Drive:> is the where SharePoint is installed

hange the Publishing feature directory to <Drive:>\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\Publishing for Office SharePoint Server 2007 and <Drive:>\Program Files\Common Files\Microsoft Shared\Web ServerExtensions\15\TEMPLATE\FEATURES\Publishing for SharePoint Server 2013

Manually add a new ElementManifest to the feature.xml. For example, add the following element
<ElementManifest Location="MyHideAction.xml"/>
Then, create a new MyHideAction.xml file in the same directory by using the following content
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<HideCustomAction Id="HideSaveAsTemplate" HideActionId="SaveAsTemplate"
GroupId="Customization" Location="Microsoft.SharePoint.SiteSettings" />
</Elements>

↑ Back to the top


References

For more information about the Feature.xml file, visit the following Microsoft Web site:

Feature.xml Files

↑ Back to the top


Keywords: kbtshoot, kbprb, kbentirenet, kbrtmpublic, kbexpertiseinter, kb

↑ Back to the top

Article Info
Article ID : 925189
Revision : 1
Created on : 1/7/2017
Published on : 3/21/2013
Exists online : False
Views : 429