Tuesday, February 3, 2009

Error when creating site from template: "The template you have chosen is invalid or cannot be found."



This happens when you save a site as a template and try to create a site from that template in a different farm.

Likely cause: Features from the source farm do not match the destination farm

Solution 1: Add or remove features to make them the same

Solution 2: So solution 1 didn't work, did it. Didn't work for me either. Here's what I did

Rename template.stp to template.cab, extract the cabinet files, then open manifest.xml in your favorite XML editor.

Scroll down to the webfeatures tag.

Next, do the same thing using a site from the destination farm.

Compare features and make sure that they match. In my case there was an extra feature in the destination farm. Even after I removed that feature from that farm, the reference to it was still in the manifest.xml


Ok, so now you've got the feature removed....that's the easy part. Now you've got the rebuild the cab file.

Download and install the cab sdk http://support.microsoft.com/kb/310618

Create a DDF file. A DDF file contains the instructions on how to package the the cab (if you've created custom WSPs you already know this).

Here's what the DDF should look like:

.Set DiskDirectory1=foldername
.Set CabinetNameTemplate=awesome.cab
.Set MaxDiskSize=CDROM

manifest.xml
therestofthefiles.etc

Then open the command prompt, navigate to the folder where you extracted everything and run "makecab.exe /f filename.ddf"

This will create a new cab file, then all you have to do is rename the awesome.cab to awesome.stp and cross your fingers and hope that it worked

No comments:

Post a Comment