Archive
HowTo remove unused features from a site template file
When you create a site template (.stp) or an export via stsadm.exe you will end up with a cabinet formatted archive with all the data and some XML files. One of these XML files, the Requirements.xml, contains references to all requirements the site template has. Unfortunately, SharePoint adds references to core features even if they’re not required. Typically, when you export a site from a SharePoint Enterprise server, all the enterprise features are included as requirements even if the feature set is turned off and not used.
To fix this you will need to modify the Requirements.xml file inside the cabinet archive. This is how I do it:
- Rename the export or template file to .cab
- Extract all content to a separate directory
- Modify the Requirements.xml by removing all lines referring to features which is not required (be careful!)
- Create a new .cab file with all the same content and the modified Requirements.xml (I use Microsoft’s cabarc.exe)
- Rename the new cabinet file with the proper file extension
- Import the file according to the SharePoint environment
Please note that any errors in the XML file or removal of actual required features may result in a corrupt cabinet file and/or a corrupted site, so BE CAREFUL!
N’Joy!