If you work with content migration in SharePoint sites, you may often need to save lists and libraries as templates so that you can re-use them in other sites. One problem you may run into (when working with big libraries especially) is a limitation in the list template maximum size.
In SharePoint 2010 and SharePoint 2013, the default list template maximum size has been set to 50 MB (52428800 bytes). During the process of saving a list or library as template, you may check the box to “Include content”. Like this (click to enlarge):
And if the library’s metadata plus its content exceeds 50 MB, you will get an error that looks like this (screenshot taken on SharePoint 2010):
The list is too large to save as a template. The size of a template cannot exceed 52428800 bytes.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: 46ed9533-1b4a-42ad-9c22-993e5008d551
Date and Time: 28/01/2018 3:33:03 PM
To fix this on your SharePoint server, just run the following code from the SharePoint management shell:
$webservice = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $webservice.MaxTemplateDocumentSize = 524288000 $webservice.Update()
In the above code, we just added an extra zero to the default value of 52428800 bytes. Now we have increased the maximum size of list templates in our SharePoint environment to 524288000 bytes (or 500 MB).
If you just want to check the current value of the list template maximum size, use the following code:
$webservice = [Microsoft.SharePoint.Administration.SPWebService]::ContentService #$webservice.MaxTemplateDocumentSize
Please note that while you can use the above method to increase the list template maximum size to whatever you want, for best performance, you may want to leave the default setting. My recommendation would be to only temporarily increase the maximum size when dealing with specific lists or libraries and then revert to the SharePoint default value after you have successfully saved the list template in question.