locked
Can't save Site Template if Web Publishing features is turned on?

    Question

  • Dear all,

    while I know and read it many times that it is not supported (while technically possible) to save the site template when web publishing is turned on, how about this approach?

    While this might not work for everybody and any situation here is where I am coming from:
    - Highly customized site collection
    - using several web publishing features
    - using pre created SharePoint groups with preloaded users

    Why can't (or can I?) (in fact I am using it over and over again) use STSADM -o Backup and STSADM -o Restore to create a new site (based on the backup)?
    I am intrerested in your thoughts around it?

    Thanks Thomas
    • Edited by Mike Walsh FIN Friday, December 18, 2009 6:54 PM Titles are only for problem descriptions. (and all posts that use tricks to get attention get deleted)
    Friday, December 18, 2009 6:17 PM

Answers

  • Tom,

    Can't comment on the other thread because I do not use stsadm -o backup / restore unless for backup / disaster recovery purposes, and in any case, that option will not work if for example the publishing site you want to backup is more than 1 level deep, and the place you want to restore it to is not going to be more than 1 level deep.

    As for the reason why Save As Template doesn't appear for publishing sites (but you can use the trick I mentioned in the other thread to get at the option), publishing sites have pages in them and layouts that are all connected to a content type that is configured at the top level site of the site collection, and because these content types are not saved and moved within the site template STP file – the STP file is not, as one would expect it to be, a true reflection of the original site.

    This means that if you save a publishing site as template and use it in the same site collection, providing all site content types it uses remain unchanged, the site template will work properly.

    The problem arises when you try to move the site template to a different site collection, or when you've changed or deleted some content types in your current site collection – this will result in unexpected behaviour (that from my experience is irritating but fixable, with some work).

    We use export / import to get around those issues instead of using backup / restore to move a template from site collection to another site collection and without any problems and you can still keep the users features in the import export - my advice would be to try out this method and see if it solves the issues you are encountering in the other thread and this one.

    These are the steps we use:

    1: Export publishing site, basic options:
    stsadm -o export -url http://mypublishingsite -filename publishingsite.cmp

    2: Create a BLANK site at the target location

    3: Now import the site over the top of the blank site:
    stsadm -o import -url http://mynewpublishingsite -filename publishingsite.cmp -overwrite


    Cheers

    Geoff
    • Marked as answer by Lu Zou-MSFT Friday, December 25, 2009 6:28 AM
    Monday, December 21, 2009 7:29 PM

All replies

  • Hi Tom

    Have you tried this?

    Go to Site Settings

    Then, remove the settings.aspx from the url and replace it with savetmpl.aspx so your url looks something like this:

    http://YOURSHAREPOINTPUBSITE/_layouts/savetmpl.aspx

    That should take you to the save site template screen where you can then save your site as a template?

    Hope this helps

    Cheers

    Geoff
    • Proposed as answer by kolmnull Tuesday, September 21, 2010 1:22 PM
    Saturday, December 19, 2009 3:13 PM
  • Yes, you CAN use STSADM -o Backup and STSADM -o Restore to create a new site from a publishing site ... just not in the same site collection.
    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura
    Monday, December 21, 2009 1:36 AM
  • Yes I know that little trick, but it is my understanding that you are loosing support (you might consider that as a side effect), but it is reported as well that you might run into issues later on with the site. That is actually the reason why MS turned off that feature (save as site template) for sites which have Publishing features enabled. 

    Thanks
    Thomas
    Monday, December 21, 2009 3:38 PM
  • Perfect .... that is what I thought and hoped for.

    But what do you think about the following then: http://social.technet.microsoft.com/Forums/en-US/sharepointcollaboration/thread/21c19855-070b-4113-bf98-21b10ef6e37f

    Thanks Thomas
    Monday, December 21, 2009 3:40 PM
  • Tom,

    Can't comment on the other thread because I do not use stsadm -o backup / restore unless for backup / disaster recovery purposes, and in any case, that option will not work if for example the publishing site you want to backup is more than 1 level deep, and the place you want to restore it to is not going to be more than 1 level deep.

    As for the reason why Save As Template doesn't appear for publishing sites (but you can use the trick I mentioned in the other thread to get at the option), publishing sites have pages in them and layouts that are all connected to a content type that is configured at the top level site of the site collection, and because these content types are not saved and moved within the site template STP file – the STP file is not, as one would expect it to be, a true reflection of the original site.

    This means that if you save a publishing site as template and use it in the same site collection, providing all site content types it uses remain unchanged, the site template will work properly.

    The problem arises when you try to move the site template to a different site collection, or when you've changed or deleted some content types in your current site collection – this will result in unexpected behaviour (that from my experience is irritating but fixable, with some work).

    We use export / import to get around those issues instead of using backup / restore to move a template from site collection to another site collection and without any problems and you can still keep the users features in the import export - my advice would be to try out this method and see if it solves the issues you are encountering in the other thread and this one.

    These are the steps we use:

    1: Export publishing site, basic options:
    stsadm -o export -url http://mypublishingsite -filename publishingsite.cmp

    2: Create a BLANK site at the target location

    3: Now import the site over the top of the blank site:
    stsadm -o import -url http://mynewpublishingsite -filename publishingsite.cmp -overwrite


    Cheers

    Geoff
    • Marked as answer by Lu Zou-MSFT Friday, December 25, 2009 6:28 AM
    Monday, December 21, 2009 7:29 PM
  • How would you get around this error message?

    "Cannot import site. The exported site is based on the template PATM#0 but the destination site is based on template STS#1. You can import sites only into sites that are based on same template as the exported site."

     

    Thursday, June 03, 2010 2:34 PM
  • Hi,

    To get around that error message you should create a placeholder site using the original sites definition / configuration (in this case PATM#0) and then import the site on top of that.

    Mark

    Monday, October 18, 2010 10:26 AM