locked
Save list / library as template missing in SharePoint Online RRS feed

  • Question

  • I can't seem to find the link to save a list or document library as a template.

    In the microsoft documentation page here that link is visible. It should be right under the "Delete this document library" link

    What could I be missing?

    Thursday, February 16, 2017 2:46 PM

Answers

  • You can construct the missing link manually.

    If you go to one of the other libraries you've created in your site, i.e. not the OOTB Documents (Shared Documents) library, go to Library Settings, you should see the "Save Library as a Template" link.  If not, you need to run the scripting enable PowerShell below first ...

    https://support.office.com/en-us/article/Allow-or-prevent-custom-script-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&rs=en-US&ad=US

     

    # Import general SPO module and connect

    Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

    Connect-SPOService -Url https://yourname-admin.sharepoint.com/

    # Enablescripting

    Set-SPOsite "https://yourname.sharepoint.com/sites/yoursite" -DenyAddAndCustomizePages 0

    Select the "Save Library as a Template" link, the address should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/savetmpl.aspx?List=xyz123

    Keep that tab of your browser open, go to another tab in your browser, and open the Library Settings page of your OOTB Documents (Shared Documents) library, the URL should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/listedit.aspx?List=abc789

    Copy the List=abc789 query string in its entirety from the OOTB Documents (Shared Documents) Library Settings tab, and paste it over the List=xyz123 in the "Save Library as a Template" link in the original tab; the address in the original tab should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/savetmpl.aspx?List=xyz123

    ... and go to the page.

    This should display the page of the missing "Save Library as a Template" link of the OOTB Documents (Shared Documents) library.

    I then filled out the details in that page for the template name and file name I wanted to save it as, and selected "Include Content".  I then got the error message ...

    Read error on file "_catalogs/lt/PIDDocuments.stp"

    I think that means my content was too large or complex for SP to cope with in saving the library as a template.

    When I cleared the "Include Content" it did save the OOTB Documents (Shared Documents) library as a template.  When I deployed a new library using the template in the same site collection it worked ok, including views I had created in that library and the content types in the library i.e. everything except the content.

    And then I used the Modern UI copy functionality to copy the content from the original Documents (Shared Documents) library to the new library created from the template, and that worked too.  Including the documents were of the correct content type i.e. not reset to the OOTB Document content type.

    I'm just going to try to do the same between site collections, just a sec ...

    Friday, November 3, 2017 8:11 PM
  • Thursday, February 16, 2017 4:26 PM

All replies

  • Thursday, February 16, 2017 4:26 PM
  • One thing that might help in your case but only if you're talking about the "Documents" library in the Team Site that gets created when you create an Unified Group (Office 365 Group)?

    In the case of the "Documents" library (/shared documents/) in a Unified Group Team Site the Save Library as a Template is missing. So is the "Save Library as a Template" link in Site Settings of the Unified Group Team Site.

    All Team Sites are equal; but some Team Sites are more equal than others, it seems.

    At first I thought this might be due to scripting being disabled in Team Sites that are created as part of the Unified Group provisioning process.  This disablement of scripting in Unified Group Team Sites over-rides the setting in SP Admin Centre -> Settings.

    However, some of the other libraries and lists that are created in a Unified Group Team Site DO have the "Save Lib / List as a template" link, and so do any lists / libs that you create subsequently in the Unified Group Team Site.

    So it appears that only the Unified Group Team Site itself and the Documents library (/Shared Documents/) of the Unified Group Team Site exhibit this "can't save as a template"/ maybe "scripting disabled" behaviour.

    This is reproducible.  Create a Unified Group, go to its asscoaited Team Site, inspect the library settings of the various libraries and the site settings for the "Save as a Template" link.  Then create your own libs / lists and inspect them too, to validate the above.

    As said, this may not be relevant to you but it's just caused me to vomit in my mouth a little for a morning or so, so it might help someone who visits this thread later.

    Maybe someone from MS can explain wtf is going on here and what the intention of this targeted functionality disablement is?


    • Edited by Bellerophon Tuesday, July 11, 2017 12:01 PM typo missed words changes meaning
    Tuesday, July 11, 2017 11:51 AM
  • So, I'm stuck in this same predicament... I created a large custom list and now I cannot export it as a template to move to another SPO site. I have limited access at work but have been tasked with a rather large project that includes multiple custom lists, which are now stuck in my personal test Group/Team. I can't understand why Microsoft would remove this important functionality. 

    Bellerophon - if you found a workaround or solution to this, I'd appreciate the help!

    Monday, October 2, 2017 5:27 AM
  • You can construct the missing link manually.

    If you go to one of the other libraries you've created in your site, i.e. not the OOTB Documents (Shared Documents) library, go to Library Settings, you should see the "Save Library as a Template" link.  If not, you need to run the scripting enable PowerShell below first ...

    https://support.office.com/en-us/article/Allow-or-prevent-custom-script-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&rs=en-US&ad=US

     

    # Import general SPO module and connect

    Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

    Connect-SPOService -Url https://yourname-admin.sharepoint.com/

    # Enablescripting

    Set-SPOsite "https://yourname.sharepoint.com/sites/yoursite" -DenyAddAndCustomizePages 0

    Select the "Save Library as a Template" link, the address should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/savetmpl.aspx?List=xyz123

    Keep that tab of your browser open, go to another tab in your browser, and open the Library Settings page of your OOTB Documents (Shared Documents) library, the URL should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/listedit.aspx?List=abc789

    Copy the List=abc789 query string in its entirety from the OOTB Documents (Shared Documents) Library Settings tab, and paste it over the List=xyz123 in the "Save Library as a Template" link in the original tab; the address in the original tab should look like this ...

    https://yourdomain.sharepoint.com/sites/yoursite/_layouts/15/savetmpl.aspx?List=xyz123

    ... and go to the page.

    This should display the page of the missing "Save Library as a Template" link of the OOTB Documents (Shared Documents) library.

    I then filled out the details in that page for the template name and file name I wanted to save it as, and selected "Include Content".  I then got the error message ...

    Read error on file "_catalogs/lt/PIDDocuments.stp"

    I think that means my content was too large or complex for SP to cope with in saving the library as a template.

    When I cleared the "Include Content" it did save the OOTB Documents (Shared Documents) library as a template.  When I deployed a new library using the template in the same site collection it worked ok, including views I had created in that library and the content types in the library i.e. everything except the content.

    And then I used the Modern UI copy functionality to copy the content from the original Documents (Shared Documents) library to the new library created from the template, and that worked too.  Including the documents were of the correct content type i.e. not reset to the OOTB Document content type.

    I'm just going to try to do the same between site collections, just a sec ...

    Friday, November 3, 2017 8:11 PM
  • Between site collections, downloading the template and uploading it appeared to work ok.

    However, when trying to copy the documents from the original OOTB Documents (Shared Documents) library to the new library created from the template in a different site collection, I got an error message "Sorry, we couldn't get the list of folders".

    That error message doesn't google out to anything useful.

    So here's mho on this.

    When MS hide a link it's usually because they don't want you to use it.  I say "usually" because MS support staff have urged me to use hidden links manually constructed in past incidents.  But you risk going down unsupported, quirky, paths when you do it.

    Whatever the "poison" is that's built into the new Group Team Site's OOTB Documents (Shared Documents) library (that makes MS want to hide the "Save as a Template" link), that poison travels with the template if you sneak around the missing link as described above when you shift the template over to another site collection.

    If you stay within the same site collection, it appears to work.  But beware:  The "Save Library as a Template" link is also missing from libraries created from the template in the same site collection.  So the "poison" has travelled with the template, but is rather more benign compared to when the template travels between site collections.

    In other words, first half usual for SharePoint:  Broken by design, failed in practice.

    Another approach is going to be using the PnP PowerShell commandlets, and string them together to parse your source library and its config and punch it all across to the target library.

    I tried that with another situation, but the PnP commandlets ran out of road - couldn't copy Folders with custom content types, it reset them to the OOTB Folder content type.

    In other words, second half usual for SharePoint:  Half-baked, never completed product.

    Friday, November 3, 2017 8:40 PM
  • I've inherited an Office 365 tenant, with the main company.sharepoint.com site collection having been created 2 years ago it seems.  No option on that site collection to save any lists or libraries as templates on the top level site nor subsites.  I created a new site collection, all fine.  I don't know anything about Powershell, can I run it on site collection level to fix this?
    Tuesday, May 15, 2018 8:59 AM
  • Check out a detailed article on Save list as a template in SharePoint 2013/2016/Online.

    Hope this will be helpful.


    Many Thanks,
    Bijay Kumar
    EnjoySharePoint.com | SharePointSky.com | TSInfoTechnologies.com

    Bijay Kumar MVP

    Wednesday, February 6, 2019 3:30 AM