Save Site as Template: Error exporting the list named “Announcements” at the URL: Lists/Announcements

August 10th, 2011

Scenario: You are working in a site collection where the root site was instantiated from a web template.  You have then created subsites which you wish to save as a web template.  Upon doing so, you receive an error.

Issue:

Error exporting the list named “Announcements” at the URL: Lists/Announcements

If you rename the list and try to save as a template again it will just give the same error with a different list, in alphabetical order.  When you look at the correlation ID you see:

SPSolutionExporter: System.NullReferenceException: Object reference not set to
an instance of an object.
at Microsoft.SharePoint.SPContentType.Serialize...

This is the one of the first lines in the log for your correlation ID.  When you look at the content types for your subsite, you see some of your custom content types but none of the defaults.  When looking at the root web for the site collection you see the same.

Resolution:

Run the SharePoint 2010 Management Shell as Administrator.  Run the following command to disable the default content type feature:

Disable-SPFeature –Identity ctypes –url http://SiteCollection

Then enable the content type feature:

Enable-SPFeature –Identity ctypes –url http://SiteCollection

If you look at your content types, they should now all be there.  Try saving the subsite as a template again, it should succeed.

13 Comments

  • Ahmed
    February 1, 2012 at 6:28PM

    Thanks , Jonathan you saved my life !!! it works perfectly

  • petka
    April 3, 2012 at 7:41PM

    Thank you, saved my butt.

  • Des Owen
    May 2, 2012 at 8:35AM

    Hi Jonathan

    I have seen this problem several times and I’m wondering if you know what causes it to happen in the first place. My client does not allow easy access to PowerShell so it can take a week to get the script run that fixes the problem but why would the content types disappear in the first place? I’m wondering if it’s related to the removal from the galery of the saved template used to create the site collection.

    Des Owen

  • Ricardo
    June 1, 2012 at 7:24AM

    Hello Jonathan

    I followed the steps you said but the problem remains.
    Also when I executed the Enable-SPfeature command iI had to add the force param otherwise I had an eror message “Content type with 0x Identifier defined at feature {xxxx}” was found at the current site collection …”

    ¿Any other ideas?

    Many thanks

  • Hans Leonhardt
    June 21, 2012 at 1:19PM

    thanks a LOOOOOTTT .. great…

  • SharePoint: Save as site template common mistakes/errors – Choroshin Alex
    September 4, 2012 at 1:15PM

    […] As posted by Jonathan Adams in this great post […]

  • Jesse
    October 8, 2012 at 10:22PM

    This worked perfectly. Really helped me out! Thanks!!!!

  • Henrik
    October 26, 2012 at 9:14AM

    Thanks, you saved us some time 🙂

  • Jess Gordon
    December 26, 2012 at 8:43PM

    I tried your solution and it did not work for me. First, it took 3 tries to execute the Disable… command (timed out the first 2 tries) then ran. The Enable… ran right away.
    However when I went back to my sub-site to save it as a template, I threw an error on the same list.

    Any ideas?

  • Erin
    February 8, 2013 at 4:16PM

    Wow, I spent an entire day trying to recover from this and was just about to call it quits and rebuild the site… thank you!!!

  • Samantha
    November 21, 2013 at 2:37PM

    Wonderful the error disapears but now I get : An unexpected error has occurred wehen I try to save as template

  • Carlos Rodrigues
    January 17, 2014 at 10:15AM

    Great 🙂

    Thanks a lot

  • Ling
    August 18, 2014 at 6:42AM

    I have error exporting list named “SPUserPoll reponses” at the URL: Lists/SPUserPoll responses while save template

    could you please give me the way to fix it.

    Many thanks.
    Sophia