Recently I have had some problems with a Custom Site Template, and after a lot of testing I decided to seek help from the brilliant and helpful SharePoint community so I added a thread at the MSDN forums.

The Problem was that I were about to update a Global Site Template. The template was sent to me from the customer and should be implemented in one of our staging environments to be tested and then finally published in the production environment.

Since this was a new version of an already existing template I started with deleting the template with stsadm (stsadm -o deletetemplate) and then I used the stsadm again to add the template (stsadm -o addtemplate). But when using the addtemplate I get:

Web template with file MyTemplateName.stp already exists

I did a enumtemplates to see if the template I deleted really had been deleted and it had. I tried to delete it again but then but got:

Could not find web template MyTeamplateName.stp

I then tried to add the template with a new name and this worked fine but when I created a new Site Collection based on the newly added template, I received yet another error message:

The template you have chosen is invalid or cannot be found.

I jumped to the conclusion a bit too fast and thought that this was related to each other. I was wrong. It turned out that this was a two folded problem and I have only found a solution to the last part.
I found out with help from a simple yet excellent Codeplex tool named STP Inspector that allows you to examine your stp file and I then found out that we did not have the same solutions (or at least same versions of solutions) in our different staging environments. The template was generated from a environment with one newer solution and therefore had Feature that was not installed on the environment were I tried to add the new template to.
To find out what feature it was I used another great tool from Codeplex, SharePoint Inspector. Both tools are very useful and I totally recommend putting them into you “toolbox” when working and troubleshooting SharePoint problems.

So what happened to the first problem? Well I have not solved this and neither have I got any response from the brilliant people on msdn forums so I guess this is a quite unique problem I have ran in to. For now I have down prioritized it but if you have a good suggestion I would much appreciate it, just leave a comment here or on the forum thread found here: http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/thread/cff841dd-00b2-4706-9a71-6f112eeef2ab



  1. User (Reply) on Sunday 7, 2009

    For your addtemplate problem (Web template with file MyTemplateName.stp already exists) read the english paragraph of this article:
    http://sharepoint.blog.hu/2010/09/28/websablonfajl_mar_letezik
    Bye!