none
Error Message Creating Site Template RRS feed

  • Question

  • Hello,

    When I go to Site Actions --> Site Settings --> Site Actions --> Save site as template, I receive an error message. I have asked several people to help me out with this, but I have received paths to find the ULS and locate the issue with the message. Instead I went to Galleries --> Solutions. When I went to 'Activate' the page, I viewed the following error message: 

    Feature definition with Id 8a754d6e-e081-4d24-bfb8-7e4a7c5136f8 failed validation, file '1ProjectCharterListInstances\ElementsFields.xml', line 3166, character 82: The 'BdcField' attribute is not allowed.

    I have gone to Central Administration -->Manage Service Applications--> Business Data Connectivity Service Application, but this is where ECT's were created and there were no ECT's created for this project. I even tried re-creating the site on a Parent Level and I still received the same error message. I have gone to \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML, per another person having a similar issue here on MSDN, but I have no Idea where to go from here. I see there is a 'BDCMetadata' and a 'BDCMetadataResource' files that will open up in Visual Studio.

    Someone else told me that I need to go to 14/TEMPLATE/FEATURES, went there too, but I have no clue what I am looking for. Someone else told me that I needed to check c:\program files\common files\microsoft shared\web server extensions\14\logs, and I did and see the log and am trying to view it for why the issue may have arisen. 

    I am still new to SharePoint and any help would be greatly appreciated.


     


    Richell A. Grant
    Monday, June 6, 2011 6:31 PM

Answers

  • When you save the site as a template, the solution (.wsp) is also activated by default. You could try to do so from SharePoint Designer to see if it makes a difference (sometimes, it does). Otherwise, you need to see the ULS logs as suggested. You could also use Powershell to save it as template as an alternative. A relevant thread that could help is here.
    AK
    • Marked as answer by R_Grant Monday, March 18, 2013 2:15 PM
    Monday, June 6, 2011 6:50 PM
  • There is an easier way to look into logs, using a tool called uls viewer. You just filter for the correlation ID you get in the error message (more details).
    As for Powershell, here's a quick reference. To save a site as template, open the SharePoint powershell (from a farm front end server start menu) and run it as administrator then enter

    $MyWeb=Get-SPWeb http://address-of-site-you-want-to-save-as-template

    $MyWeb.SaveAsTemplate("Template Name","Template Title","Template Description",0)
    Of course, you specify template name and description and use 1 instead of zero if you want to include content.
    AK

    • Marked as answer by R_Grant Monday, March 18, 2013 2:15 PM
    Tuesday, June 7, 2011 4:50 AM

All replies

  • When you save the site as a template, the solution (.wsp) is also activated by default. You could try to do so from SharePoint Designer to see if it makes a difference (sometimes, it does). Otherwise, you need to see the ULS logs as suggested. You could also use Powershell to save it as template as an alternative. A relevant thread that could help is here.
    AK
    • Marked as answer by R_Grant Monday, March 18, 2013 2:15 PM
    Monday, June 6, 2011 6:50 PM
  • When you save the site as a template, the solution (.wsp) is also activated by default. You could try to do so from SharePoint Designer to see if it makes a difference (sometimes, it does). Otherwise, you need to see the ULS logs as suggested. You could also use Powershell to save it as template as an alternative. A relevant thread that could help is here.
    AK

    What do you mean I can 'try to do so from SharePoint Designer'? How do I create a template from SPD? I printed out the ULS Log and been weeding through it line by line, but even if I find something, I don't know what to do or even if I found something, that's how new I am to SharePoint, but I am trying my best :). Also, I have not worked with PowerShell and wouldn't know the first thing to do with PowerShell. Besides, I read somewhere that Microsoft did something where we aren't or can't bypass using PowerShell. If that's not true, please let me know and guide me to the right location where I can learn how to do this properly. Thank you. :) 


    Richell A. Grant
    • Edited by R_Grant Monday, June 6, 2011 8:20 PM Update
    Monday, June 6, 2011 8:01 PM
  • Ok, found the 'Save as Template' in SPD icon and I still receive the same error message. Still looking in the ULS log.
    Richell A. Grant
    Monday, June 6, 2011 8:23 PM
  • There is an easier way to look into logs, using a tool called uls viewer. You just filter for the correlation ID you get in the error message (more details).
    As for Powershell, here's a quick reference. To save a site as template, open the SharePoint powershell (from a farm front end server start menu) and run it as administrator then enter

    $MyWeb=Get-SPWeb http://address-of-site-you-want-to-save-as-template

    $MyWeb.SaveAsTemplate("Template Name","Template Title","Template Description",0)
    Of course, you specify template name and description and use 1 instead of zero if you want to include content.
    AK

    • Marked as answer by R_Grant Monday, March 18, 2013 2:15 PM
    Tuesday, June 7, 2011 4:50 AM
  • Here is what I found from the ULS Viewer:

    w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Request (POST:http:// /Project/_layouts/savetmpl.aspx))
    w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Logging Correlation Data xmnv Medium Name=Request (POST:http:// /Project/_layouts/savetmpl.aspx) 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Logging Correlation Data xmnv Medium Site=/ 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=12.7525294395875 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    OWSTIMER.EXE (0x1CAC) 0x10D4 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job job-application-server) f280be4d-f2fe-4695-8d6e-31a7ce3cc012
    OWSTIMER.EXE (0x1CAC) 0x10D4 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job job-application-server). Execution Time=2.53074859543453 f280be4d-f2fe-4695-8d6e-31a7ce3cc012
    OWSTIMER.EXE (0x1CAC) 0x2A44 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job Health Statistics Updating) 4913212b-0774-4fef-9318-a86b32086e58
    OWSTIMER.EXE (0x1CAC) 0x2A44 SharePoint Foundation Topology 8xqz Medium Updating SPPersistedObject
    SearchServiceApplicationMonitoring Name=Monitoring_7F19A5D194F942e6A9856FCFD6EE6F63. Version: 639018 Ensure: False, HashCode: 1614248, Id: 3ee4d239-4cc9-4539-9e13-4dfb012df03f, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()     at Microsoft.Office.Server.Search.Monitoring.TraceDiagnosticsProvider.UpdateServiceApplicationHealthStats()     at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)     at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result) 4913212b-0774-4fef-9318-a86b32086e58
    06/07/2011 09:06:30.74 OWSTIMER.EXE (0x1CAC) 0x2A44 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job Health Statistics Updating). Execution Time=40.8853780327531 4913212b-0774-4fef-9318-a86b32086e58
    06/07/2011 09:06:30.78 w3wp.exe (0x1A50) 0x2E90 Access Services Data Layer 8jg2 Medium ResourceManager.PerformCleanup: Memory Manager: CurrentSize=681357312. 53fed7f1-f8f4-2342-0000-000050f7b00c
    06/07/2011 09:06:31.45 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Team Discussion). Execution Time=204.276441523127 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.45 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Add WebParts#86). Execution Time=204.367548472562 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.52 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#5). Execution Time=12.5685701968573 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.52 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#6). Execution Time=9.59136264231098 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.53 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#7). Execution Time=12.5647304403677 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.55 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#8). Execution Time=9.07508992884233 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.56 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#9). Execution Time=13.0384167636787 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.58 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#11). Execution Time=11.7018324365175 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.59 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#12). Execution Time=11.2941201110737 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.59 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#13). Execution Time=10.8448686017876 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:31.81 w3wp.exe (0x1A50) 0x2C54 Access Services Data Layer 8jg2 Medium ResourceManager.PerformCleanup: Disk Manager: CurrentSize=0. 11c5f189-f8f4-2342-0000-000050f7b00c
    06/07/2011 09:06:32.72 OWSTIMER.EXE (0x1CAC) 0x0654 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job Search Health Monitoring - Trace Events) e64e2b2a-32b6-402a-be85-bc939eb9ff8b
    06/07/2011 09:06:32.72 OWSTIMER.EXE (0x1CAC) 0x0654 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job Search Health Monitoring - Trace Events). Execution Time=10.2877548420202 e64e2b2a-32b6-402a-be85-bc939eb9ff8b
    06/07/2011 09:06:33.64 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=12.4373203386665 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.72 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#17). Execution Time=10.7935554923353 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.90 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Topology umad Medium Solution Deployment : Looking for 'ReceiverAssembly' attribute in manifest root node for solution 'Project Charter2.wsp'. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.90 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Topology umae Medium Solution Deployment : Looking for 'ReceiverClass' attribute in manifest root node for solution 'Project Charter2.wsp'. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.90 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Topology umal Medium Solution Deployment : Missing one or more of the following attributes from the root node in solution Project Charter2.wsp: assembly '', type ''. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.93 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation General 9fjj Monitorable SPSolutionExporter: Microsoft.SharePoint.SPException: Feature definition with Id 110e214c-5235-4a79-b8fd-3a3244743122 failed validation, file '1ProjectCharterListInstances\ElementsFields.xml', line 3166, character 82: The 'BdcField' attribute is not allowed.     at Microsoft.SharePoint.Administration.SPSolutionPackage.SolutionFile.FeatureXmlValidationCallBack(Object sender, ValidationEventArgs evtargs)     at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(String code, String arg)     at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String lName, String ns, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo)     at System.Xml.XsdValidatingReader.ValidateAttributes()     at System.Xml.XsdValidatingReader.ProcessElementEvent()     at System.Xml.XsdValidatingReader.Read()     at System.Xml.XmlReader.MoveToContent()     at System.Xml.XmlReader.IsStartElement()     at Microsoft.SharePoint.Utilities.SPUtility.XsdValidateXml(XmlTextReader xmlStreamReader, String friendlyName, String pathXsdFile, String tagExpectedRootNode, ValidationEventHandler xsdValEventHandler)     at Microsoft.SharePoint.Administration.SPSolutionPackage.SolutionFile.ValidateFeatureXmlFile(String rootTagElement)     at Microsoft.SharePoint.Administration.SPSolutionPackage.AddFeatureElementsCore(XmlNodeList nodeList, String strFeatureDirRelativeToCabFile, Guid featureId, Dictionary`2 filesAdded)     at Microsoft.SharePoint.Administration.SPSolutionPackage.AddFeatureElements(XmlNode root, String strFeatureDirRelativeToCabFile, String strFeatureXmlFilename, Guid featureId)     at Microsoft.SharePoint.Administration.SPSolutionPackage.WspSolutionFeature.ProcessFeatureXml()     at Microsoft.SharePoint.Administration.SPSolutionPackage.InitSolutionFeatures(XmlNode root)     at Microsoft.SharePoint.Administration.SPSolutionPackage.ProcessSolutionManifest()     at Microsoft.SharePoint.Administration.SPSolutionPackage.Load()     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.CreateSolutionPackage(SPRequest request, String name, String signature, Byte[] fileBytes)     at Microsoft.SharePoint.SPUserSolutionCollection.<>c__DisplayClass1.<AddOrUpgrade>b__0()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPUserSolutionCollection.AddOrUpgrade(SPListItem item, SPUserSolution existingSolution)     at Microsoft.SharePoint.SPUserSolutionCollection.Add(Int32 solutionGalleryItemId)     at Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent, String workflowTemplateName, String destinationListUrl) 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.93 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Runtime tkau Unexpected System.InvalidOperationException: Error copying temporary solution file to solutions gallery: _catalogs/solutions/Project Charter2.wsp    at Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent, String workflowTemplateName, String destinationListUrl)     at Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent)     at Microsoft.SharePoint.ApplicationPages.SaveAsTemplatePage.BtnSaveAsTemplate_Click(Object sender, EventArgs e)     at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.95 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Performance nask Monitorable An SPRequest object was not disposed before the end of this thread.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  This object will now be disposed.  Allocation Id: {FD36747E-91CF-43D5-A512-D6302254D976}  To determine where this object was allocated, set Microsoft.SharePoint.Administration.SPWebService.ContentService.CollectSPRequestAllocationCallStacks = true. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.95 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Performance nask Monitorable An SPRequest object was not disposed before the end of this thread.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  This object will now be disposed.  Allocation Id: {2949D429-CD91-431F-9F52-37A89F11B3BD}  To determine where this object was allocated, set Microsoft.SharePoint.Administration.SPWebService.ContentService.CollectSPRequestAllocationCallStacks = true. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.95 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Performance nask Monitorable An SPRequest object was not disposed before the end of this thread.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  This object will now be disposed.  Allocation Id: {34651BFE-E7C8-48EA-9BFA-583E11E02F40}  To determine where this object was allocated, set Microsoft.SharePoint.Administration.SPWebService.ContentService.CollectSPRequestAllocationCallStacks = true. 42ea0094-cd5c-49ea-bfa6-932843c2ff36
    06/07/2011 09:06:33.95 w3wp.exe (0x1E30) 0x26F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Request (POST:http:// /Project/_layouts/savetmpl.aspx)). Execution Time=5219.04728660117 42ea0094-cd5c-49ea-bfa6-932843c2ff36

    I (BUI) what I don't understand or I know it's an error but I have no idea how to fix these. This is what I found in the ULS Viewer! This is so much easier than how I was looking at this log yesterday and Friday. 

     


    Richell A. Grant
    Tuesday, June 7, 2011 1:45 PM
  • Was this site migrated from 2007? Or, did you use any custom solutions/features/templates in the site (ex. like those Fab40 templates)? If you have non-SharePoint features, you can deactivate them before trying to save.
    AK
    Tuesday, June 7, 2011 2:12 PM
  • For the PowerShell I signed into the Farm as Admin and went to SharePoint 2010 Management Shell entered in the above code and was given the following message:
    -----------------------------------
    PS C:\Users\sp2010farm> $MyWeb=Get-SPWeb http://the site of my address/default.aspx
    $MyWeb.SaveAsTemplate("Project Charter","Project Charter","Use this Project Char
    ter template for new projects.",1)
    You cannot call a method on a null-valued expression.
    At line:1 char:78
    + $MyWeb=Get-SPWeb http://site of my address/default.aspx $MyWeb.SaveAsTemplate
     <<<< ("Project Charter","Project Charter","Use this Project Charter template f
    or new projects.",1)
        + CategoryInfo          : InvalidOperation: (SaveAsTemplate:String) [], Ru
       ntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    -----------------------------------

    I tried this a few times and I am receiving the same results.

    Richell A. Grant
    Tuesday, June 7, 2011 2:17 PM
  • They are using Moss 2007 at the moment, however they migrating to SP2010 and there is already a server prepared for this which I am working with. Most of the transfers, updates and migrations have occurred before I began. So I am learning as I go :) . I used the 'Document Workflow' and made modifications to it using SPD to get the template that my manager indicated he preferred. Am I not allowed to do that? I have a 'test site', that does not touch our main site so if I break something it won't affect the main portal. I created a template in the test site several times without issues. So this has me concerned what happened to the Main Portal. I do appreciate your help as I am learning, through forums, trial and error and books. Can't go to training just yet, so I am using every possible tool I can find to learn and enhance my skills. 

    Richell :) 
    Richell A. Grant
    Tuesday, June 7, 2011 2:30 PM
  • Ok, so instead of asking you something i could find on my own, i found out what Fab40 Template are. 

    http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/dba58b59-c4aa-4a06-aff8-060b929c4650

    No, I didn't use Fab40, I modified what SP2010 gave me in SPD to fit the specifications that were given to me. The closest template to what was required included having a list of users in a group for a project and that is what 'Document Workspace' gives, along with Tasks and announcement. I changed Announcement to Project, but can't seem to modify the (Add new Announcement to Add new Project) possibly because this is a webpart and they are (I want to say) bound. 

    Also found this: Fab40 Templates for SharePoint 2010


    Richell A. Grant
    • Edited by R_Grant Tuesday, June 7, 2011 2:46 PM update link
    Tuesday, June 7, 2011 2:43 PM
  • For the ps commands, do them one at a time in the same session (or put in a text file with.ps1 extension and run the file). Also, leave the address without the default.aspx (http://the site of my address/). It may take a while and you will either receive a new ps prompt (success) or a red error message (very likely).
    Remote troubleshooting is not easy and you may want to get the previous team on board or look into the old environment to see what components/features were used. This seems to be caused by a special feature.
    Another tool that could help you (even if not in this case) is SharePoint Manager (http://spm.codeplex.com). You can inspect the farm and check solutions, features and a lot more.
    AK


    • Edited by AbedKhooli Tuesday, June 7, 2011 3:46 PM corrected link
    Tuesday, June 7, 2011 3:17 PM
  • Ok, this is what I got this time:

     

    PS C:\Users\sp2010farm> $MyWeb=Get-SPWeb http://portal/Project/
    PS C:\Users\sp2010farm> $MyWeb.SaveAsTemplate("Project Charter","Project Charter","Use this template to create a new project for Project Charter.",1)

    Exception calling "SaveAsTemplate" with "4" argument(s): "Error copying temporary solution file to solutions gallery: _catalogs/solutions/Project Charter.wsp"

    At line:1 char:22

    + $MyWeb.SaveAsTemplate <<<< ("Project Charter","Project Charter","Use this template to create a new project for Project Chater.",1)

        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

        + FullyQualifiedErrorId : DotNetMethodException

    ---------------------------

    There is no other SharePoint person here. I am the only one. My manager did some work with MOSS2003, but it ended up being used for documentation purposes...Sorry, I said 2007 earlier. Maybe that could be the reason? But I still don't understand how I can create a site template with my test site but not the main portal, strange.  Thank you for the tools! I'm defiantly checking them out and will be using them. :) 

    PS. The Link is broken :(


    Richell A. Grant


    • Edited by R_Grant Wednesday, June 8, 2011 6:02 PM
    Tuesday, June 7, 2011 3:36 PM
  • Link corrected. Try the ps command with 0 instead of 1. Notice that saving contents along with site has a limit on size (I think it is around 400 MB).
    AK
    Tuesday, June 7, 2011 3:52 PM
  • This gives the same error message.

     

    PS C:\Users\sp2010farm> $MyWeb=Get-SPWeb http://portal/Project/
    PS C:\Users\sp2010farm> $MyWeb.SaveAsTemplate("Project Charter","Project Charter","Use this template to create a new project for Project Charter.",0)

    Exception calling "SaveAsTemplate" with "4" argument(s): "Error copying temporary solution file to solutions gallery: _catalogs/solutions/Project Charter.wsp"

    At line:1 char:22

    + $MyWeb.SaveAsTemplate <<<< ("Project Charter","Project Charter","Use this template to create a new project for Project Chater.",1)

        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

        + FullyQualifiedErrorId : DotNetMethodException

     

     

    What about the main error that I mention in the first post about the BDCfield is not an attribute? Shouldn't I try to fix that? How? I have noticed after entering the few lines here in PS, when I go to Galleries --> Solutions a Template is created, however when I select 'Activate' I receive the following message: 

    ERROR:
    Feature definition with Id e2372e4f-49a6-4987-bd5e-e7f446e3c675 failed validation, file '1ProjectCharterListInstances\ElementsFields.xml', line 3166, character 82: The 'BdcField' attribute is not allowed.

     

    Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID: 0aceb3a1-9389-46cf-ad98-d246c9f22e50

    Date and Time: 6/7/2011 1:12:22 PM


    Richell A. Grant
    • Edited by R_Grant Wednesday, June 8, 2011 6:01 PM
    Tuesday, June 7, 2011 5:15 PM
  • The error message still references your earlier command (with 1, not 0). If PS succeeds, the solution will be activated already. You certainly have an issue with that message. Do you have a solution called 1ProjectCharter in the gallery? Is it activated? It may be the cause of the problem. Otherwise, inspect all site collections and site features at http://tkseportal/Project/
    AK
    Tuesday, June 7, 2011 5:52 PM
  • I couldn't copy the error with the 0, but the error message looked the same. I was able to copy the message this time and the error is below. I don't even see a solution in the Gallery with 1ProjectCharter. There are no templates in the gallery because I didn't create any.

    I did have it activated in a different site collection, I deactivated and removed them. Also, in the main site I gave the template a different name 'New Project Charter' and I still receive the same error message. 

    -------------------------------------------------------------
     

    PS C:\Users\sp2010farm> $MyWeb=Get-SPWeb http://portal/Project/
    PS C:\Users\sp2010farm> $MyWeb.SaveAsTemplate("Project Charter","Project Charter
    ","Use this template to create a new project for Project Charter.",0)
    Exception calling "SaveAsTemplate" with "4" argument(s): "Error copying tempora
    ry solution file to solutions gallery: _catalogs/solutions/Project Charter.wsp"
    At line:1 char:22
    + $MyWeb.SaveAsTemplate <<<< ("Project Charter","Project Charter","Use this tem
    plate to create a new project for Project Charter.",0)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    ---------------------------
    'Project' was just added last week as a child site of the portal. I tried creating this same template under a grandchild site of the portal, but that didn't work (same error messages about the BdcField). So, I thought I had to create the template at a higher level, so I created 'Project' as a subsite of the portal, hoping that would resolve the issue. Well, that brings us to where we are today. Thank you for all your help, seriously. Some people would begin helping and then leave me hanging. It gets frustrating sometimes because I really want to learn and I want to get this done. I am planning on getting Microsoft certified for SharePoint. I have reviewed some of the courses and taken the free tutorials, even took tutorials with New Horizon Online. 

     


    Richell A. Grant

    Tuesday, June 7, 2011 6:21 PM
  • I found a site that had Project Charter as the name of the site. for the heck of it i went to create a site template and I COULD!!! Then I removed the template and deleted the site! So, since I can create a template in a child site, why can't I create the template on a higher level? I'm going to recreate the site from where I deleted it and create the template. Hope this works! :)

    Richell A. Grant

     

    -------Update------

    I recreated the template under another site collection, but then I learned I cant use that template just anywhere. Wish i could it would make this so much easier. So I can only use the templates I create under the site collections I create them in?

     

    Tuesday, June 7, 2011 7:55 PM
  • I created the site template in a different area, then saved and exported the site to where I want the site located.
    Richell A. Grant
    Wednesday, June 8, 2011 12:40 PM
  • I believe the original one had a left-over feature (BDC) from the old version. Notice that you can download and inspect a .wsp file (it is just a cab file and can be opened with tools like winrar, 7zip and the likes).
    AK
    Wednesday, June 8, 2011 1:00 PM
  • Ok, I was able to get the custom template to work on all pages except the wiki page which is the parent page. The Wiki is a list of projects. Each project has to have its own site. So I have the site so far where the user will select on the name of the project (the wiki), then a pop up opens with a link the user selects the link to be taken to the page where the project is located. (I dont like the pop up, wish the user can select the name of the project and be take to the page automatically without those extra steps). If I can't add a custom template to the wiki, then this page will have to be re-created. 

    Can I add a custom template to a wiki? The in the Galleries --> Solution shows the Template is there and activated, but when I go to New Site it's not visible. If I can get this, then this project will be complete. I would hate to have to re-create this Wiki...but if I must then I must. This is the ONLY site that won't allow me to use my custom template. 

    For the heck of it, I also created another Wiki and it didn't display my custom template either. 


    Richell A. Grant
    Wednesday, June 8, 2011 2:49 PM
  • So, from site actions, you click  More Options (below New Site). In the filter by, you select Site and in the categories, you select Blank & Custom and don't even see the template you saved? This seems strange.
    You can use Powershell to create a new site with no specific template. Then, you apply the template in a new command. Here's a helpful link on how to do it. notice that you can use SharePoint Manager to get the GUID if you have it installed.
    AK
    Wednesday, June 8, 2011 3:15 PM
  • Ok, this is where I am now. At first I was not understanding number 5, but got it now....so this is what I am receiving at the moment.
    ----------------------------------------------------
    PS C:\Users\sp2010farm> $web.ApplyWebTemplate("{03D9A573-36F1-4865-B475-78DE0CBD1486}#1ProjectCharter")
    You cannot call a method on a null-valued expression.  
    + $web.ApplyWebTemplate <<<< ("{03D9A573-36F1-4865-B475-78DE0CBD1486}#1ProjectCh
    arter")
        + CategoryInfo          : InvalidOperation: (ApplyWebTemplate:String) [],
       RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    PS C:\Users\sp2010farm> $web=New-SPWeb http://portal/costcenters/cis/Project
    Charter
    New-SPWeb : The Web site address "/costcenters/cis/ProjectCharter" is already i
    n use.
    At line:1 char:15
    + $web=New-SPWeb <<<<  http://portal/costcenters/cis/ProjectCharter
        + CategoryInfo          : InvalidData: (Microsoft.Share....SPCmdletNewWeb:
       SPCmdletNewWeb) [New-SPWeb], SPException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewWeb
    l
    • Edited by R_Grant Wednesday, June 8, 2011 6:00 PM
    Wednesday, June 8, 2011 4:01 PM
  • Looks like we are back to the old error. you can try the stsadm (end of that article) from a DOS prompt (the stsadm.exe file is in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN). Sometimes stsadm works even if Powershell fails.
    AK
    Wednesday, June 8, 2011 5:26 PM
  • Is it possible that Wiki will not allow custom templates added as subsites? 


    From DOS: 

     

    C:\Users\sp2010farm>stsadm -o createweb -url http://portal/costcenters/cis/P

    rojectCharter- sitetemplate "{03D9A573-36F1-4865-B475-78DE0CBD1486}#1ProjectChar

    ter"

    'stsadm' is not recognized as an internal or external command,

    operable program or batch file.

     

     

    Do i want to look at the Application or XML Configuration? I have the Configuration open at the moment and there is not much in there.

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <runtime>
      </runtime>
    </configuration>

     

    I went to the STSADM Application on the server and ran it. Went back to the site and the template still does not show. It's odd that it's active, but not viewable.


    Wednesday, June 8, 2011 5:39 PM
  • The STSADM is in the path I mentioned above. You have to be in that folder (bin) to run it (or add the path to your environment).
    When you ran the powershell command, you should see (in your site, all site contents) the site you created, but if you click on it, you are asked to select a template - you may be able to see your custom template if allowed.
    For sub site templates, check this blog post.
    AK
    Wednesday, June 8, 2011 6:09 PM
  • Ok, I was able to view all of the sites when I ran the powershell command. Now in the BIN\STSADM when I select 'open' or 'run as administrator' the screen opens and shuts very fast so I can't view that data and I forgot the command to use so I can view the data in that screen. 

    Thank you for the post. 


    Richell A. Grant
    Wednesday, June 8, 2011 6:30 PM
  • Instead of C:\Users\sp2010farm>stsadm -o createweb -url ... you do (on one line):
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\stsadm -o createweb -url http://portal/costcenters/cis/ProjectCharter- sitetemplate "{03D9A573-36F1-4865-B475-78DE0CBD1486}#1ProjectCharter"

    But run the cmd prompt as admin
    AK

     

    Wednesday, June 8, 2011 6:40 PM
  • You are going to love this, but that is the least of my worries. I was trying to recreate the site and when I deleted, I accidently deleted the entire portal. would you happen to know if there is a way that I can get it back?
    Richell A. Grant
    Wednesday, June 8, 2011 6:48 PM
  • From a backup, if you have one. I believe there is another way using the db, but I don't recall the procedure.
    AK
    Wednesday, June 8, 2011 6:51 PM
  • I came up with a solution to an identical problem that worked for me, but it involved working directly in database, typically not supported by Microsoft.

    I reviewed my file 'testingListInstances\ElementsFields.xml', line 273

    <Field Type="Note" DisplayName="CW Companies_ID" BdcField="CW Companies_ID" ID="{0e0edfc0-dd5d-438d-8197-7271f73954ab}" SourceID="{02435fef-a28b-4dc7-970c-cd411194d4f5}" StaticName="CW_x0020_Companies_ID12" Name="CW_x0020_Companies_ID12" Hidden="TRUE" ReadOnly="TRUE" Overwrite="TRUE" />

    and found that this information was still stored in the content database within the 'ContetTypes' table, in the 'Definition' field. I found the orphaned records that were not removed in when I deleted the site column, external list, external content type, and removed the list columns that reference the external content type. So I decided to delete these records that referenced the failing BdcFields. Once I did this I was able to create new site templates that activated without any errors.

    I hope this helps anyone else having the same problem that I had.

    Thank you,

    Kevin

    Sunday, February 12, 2012 3:14 PM
  • Hi,

    First thing is choosing the "Save As Template" to create new one from or migrated the site to be reviewed.

    Template saving requires identical configuration,server/farm settings must be same as source server.
    As you have only one custom solution on this site,look around to take this custom solution to be deployed on new server.
    Then continue to save the site as template and restore it on the target server.


    Murugesa Pandian.,MCTS|App.Devleopment|Configure

    Sunday, February 12, 2012 5:25 PM
  • Here is what happened from that incident. The manager had me code something for him that was more complex than my entry level postion would allow, so they let me go. Now I am working for a different company where I am a SharePoint Admin/Designer and I am LOVING IT! I don't know if I will ever run into PS again with my duties, but if I do, I know there are great people on here that are VERY intelligent~! :)


    Richell A. Grant

    Wednesday, February 27, 2013 8:26 PM
  • Hi Kevin

    Thank you SO much for sharing this! This SOLVED the problem for me :)

    Steps taken:

    • Save site as template. This will fail, but the solution file will be present in solution gallery
    • Save the solution from the solution gallery to a local destintaion. This will give you a .wsp file
    • Rename the .wsp file to .cab. Double click and find the "ElementsFields.xml" file
    • Open the XML file and search for "bdcField" or maybe the name of the deleted column if you know it
    • Note the value of displayname and bdcfield - close the XML file Again, you dont need it anymore
    • Open your SQL Server content database directly and find the table "ContentTypes".
    • BACK IT UP!
    • Search for the values (or similar) as you noted earliere
    • DELETE the row containing your value - should be one or few rows
    • Now - create a Site template Again. Hopefully it Works like mine did :)

    Happy problem solving!

    Torben Johansen

    Tuesday, May 20, 2014 7:44 AM