Tuesday, June 19, 2007

Changing Custom Site Definition Template IDs - SharePoint 2003

The following steps walk through changing custom template IDs so they are greater than 10000 per documented best practices.  Always make sure to backup all databases and files prior to making any changes.


NOTE: Microsoft does not support editing SharePoint SQL tables directly...




  • Make a backup copy of all %programfiles%common filesmicrosoft sharedweb server extensions60Template1033XMLwebtempXXX.xml on all front-end web servers.


  • Open each webtempXXX.xml.  Below is an example webtempXXX.xml file with custom templates.

<Templates>


<Template Name="SPSCONTOSOSERVICES" ID="37">


    <Configuration ID="0" Title="Area Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Contoso Services Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


 <Template Name="SPSCONTOSOBUSINESSES" ID="38">


    <Configuration ID="0" Title="Contoso Businesses Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Area Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


 <Template Name="SPSCONTOSOTOPICS" ID="39">


    <Configuration ID="0" Title="Contoso Topics Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Area Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


</Templates>




  • Replace the IDs with numbers over 10000.  It is easiest just to add a 1 and 0 or 00 in front of the existing template IDs.

<Templates>


<Template Name="SPSCONTOSOSERVICES" ID="10037">


    <Configuration ID="0" Title="Area Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Contoso Services Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


 <Template Name="SPSCONTOSOBUSINESSES" ID="10038">


    <Configuration ID="0" Title="Contoso Businesses Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Area Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


 <Template Name="SPSCONTOSOTOPICS" ID="10039">


    <Configuration ID="0" Title="Contoso Topics Template" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="Area Template."><!-- _locID@Title="webtemp_title_spstopic0" _locComment="{StringCategory=HTX}" --> <!-- _locID@Description="webtemp_desc_spstopic0" _locComment="{StringCategory=HTX}" --></Configuration>


 </Template>   


</Templates>




  • Open Query Analyzer on the SQL Backend and perform a query resembling the following on all Content Databases:


update webs set webtemplate = 10038 where webtemplate = 37;


update webs set webtemplate = 10038 where webtemplate = 38;


update webs set webtemplate = 10039 where webtemplate = 39;


GO


Replace the numbers in the query with ones specific to the environment.  These numbers must match the ones included in the webtempXXX.xml file(s).




  • Perform an iisreset /noforce on all front-end servers.


  • Launch the portal to verify that the templates are still working properly.

No comments:

Post a Comment