Home > English, SharePoint, TechNotes > HowTo remove unused features from a site template file

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:

  1. Rename the export or template file to .cab
  2. Extract all content to a separate directory
  3. Modify the Requirements.xml by removing all lines referring to features which is not required (be careful!)
  4. Create a new .cab file with all the same content and the modified Requirements.xml (I use Microsoft’s cabarc.exe)
  5. Rename the new cabinet file with the proper file extension
  6. 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!

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: