in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Dave Wollerman's SharePoint Blog

I use this blog to share information with the community plus also as a repository for reference material on unique situations that I have come across.

View Dave Wollerman's profile on LinkedIn      Sogeti Logo

Using a Site Template (STP File) to create a site collection

Site templates can be very useful for an easy custom starting point for common site usage. Site templates can be saved from any site (except publishing sites for some reason... Smile ). These site templates are stored into the site collections site template gallery as STP files. Once they are created a user with permissions can create sites within that site collection based on that template.

What happens if you want to use that site template to create a top level site in a site collection. When creating a site collection you are only shown available templates that are global to the entire farm. If you want to use your custom site template when creating a site collection follow the instructions below...

  1. Create your site template (I assume you already know how to do this, but if not go to the site settings of any web and select "Save Site as Template")
  2. Navigate to the site template gallery where the site template is saved. This will be under Site Settings -> Galleries -> Site Template Gallery.
  3. Save the custom site template to the SharePoint server local drive.
  4. Remote Desktop into the SharePoint server where the STP file has been saved, and open a command prompt.
  5. Use STSADM to upload the template into the global templates list by using the STSADM -o AddTemplate command. For help with the AddTemplate command use STSADM -help addtemplate.

obviously make sure you either specify the path to stsadm in the command line, or as part of the server's PATH variable. Also, if you are not in the folder where the STP file exisits, you will have to specify the full path to the STP file as well. Remember if there are spaces anywhere in the path you will have to surround the full path with double quotes.

Comments

 

Sharad said:

Did you take notice of default web-part gallery. Try populating web-part on newly created site from such a stsadm registered stp...

1. Your web-parts setup on pages, say Home, do not appear.

2. Try adding from gallery, they don't appear in list. You have to go and add them.

Why?

April 21, 2008 7:58 PM
 

Robin said:

Note that the workflow features do not work properly if your sitetemplate is being saved while the features are active.

April 22, 2008 3:41 AM
 

dwollerman said:

Sharad, I have not run into that situation. I will have to test this out to see. What type of site are you saving as a template?

I have run into issues where team sites (or publishing sites) that had the publishing infrastructure enabled needed to make a template. Since you do not have the option to create a site template when publishing is enabled, we turned it off then created the template. When we created a site from that template and turned publishing back on, it still did not function properly. I guess my point here is to make sure this is not a publishing site, or a site that has (or had) the publishing infrastructure turned on.

April 22, 2008 6:44 AM
 

Nicki said:

You may want to note that it's a good idea to iisreset after adding a template via the cmd line.

April 22, 2008 9:25 AM
 

desktop publishing quotes said:

Pingback from  desktop publishing quotes

May 1, 2008 4:16 AM
 

Olivier said:

I got the same problem as decribed by Sharad.

Any solution / fix?

May 28, 2008 8:31 AM
 

dwollerman said:

Olivier,

Can you provide me with more details, such as what type of site was the template created from and more details on what you are seeing / not seeing as far as the web part gallery goes and I will look into it. You can email me directly with the information if you like (dave.wollerman@gmail.com)

May 28, 2008 8:41 AM
 

Peter said:

Same issue here -- web part gallery is empty. Basically started with vanilla team site, enabled a few features, tweaked home page layout and content. Thought it might be related to not including content in the template, but doing so didn't help.

June 11, 2008 1:31 PM
 

Paul said:

Has anyone resolved the empty webpart gellery issue. I am having the same problem with .stp templates deployed to the central template gallery. It does not seem to matter which site defnitition the template is based on I always end up with an empty web part gallery in the new site collection. I have tested this before and not found a problem so I am not sure what could have changed.

July 30, 2008 5:17 AM
 

Kelly said:

I tried this and it worked - great tip, solved the problem I was having

August 7, 2008 4:59 PM
 

Sudha said:

When i create the site template all the subsites under it are not getting included when i restore the template.

Am I dng any mistake in saving site template..I even tried with Include Content

August 8, 2008 1:56 AM
 

dwollerman said:

Sudha.

The site template does not include sub sites. It is not meant to build a complete solution template. If you need to have sub sites or a stucture automatically created like the "collaboration portal" template, then you need to create a site definition to handle it.

August 10, 2008 4:00 PM
 

Ian said:

I was provided a collection of .stp files to view.  I added one using the procedure described above and then realised it is actually under a Project Server 2007 instance / site I need to add it under.  Do I now somehow access this from the Global Templates section and add this from the Project Server instance?  I.e projectserverinstance/.../default.aspx type instance.

August 22, 2008 1:08 AM
 

dwollerman said:

Ian,

The global templates are used across the entire farm and allows you to utilize an STP template when creating site collections. Within a site collection you have a site template gallery where the STP templates can only be used within that site collection if just added to that site collections site template gallery.

I am not sure exactly what you are asking. A SharePoint farm and a project server farm is usually 2 separate farms and adding the STP files to the global templates in the sharepoint farm will mean they cannot be utilized in the project server farm or any other farm. if you are just talking site collections then adding them to the global templates will allow the templates to be used within all site collections that exist within the farm.

August 22, 2008 6:51 AM
 

Ian said:

thanks...  I successfully  managed to create a site on the 'epmdemo2007' (Microsoft VM Demo system) from one template, although using this technique (after issreset) and also trying again by uploading the tempates directly using Site Administration, I encounter the error that the 'specified template can not be found'.  I'm stuck :-(  The templates do appear under the 'custom templates' tab when selecting a template to create a site from, although there is an entry for the templates added using stsadm and uploaded using Site Settings -> Galleries -> Site Templates (neither of which work).  Sounds like I have broken something?

August 25, 2008 7:31 PM
 

dwollerman said:

Sounds like something is confused. If both are named the same then there might be a conflict causing it to fail because it finds more than one.

Use the "stsadm -o enumtemplates" command to see if your template is still part of the global admin templates. Try removing one of them (either the global or the local in the site collection gallery). You can remove the global with the "stsadm -o deletetemplate" command.

Also, check the logs (application and sharepoint uls) for more information related to why it cannot find the specified template in the error.

August 26, 2008 7:26 AM
 

Blog del CIIN said:

Como sabéis, una de las posibilidades que ofrece la plataforma SharePoint para hacer backup & restore

September 15, 2008 2:21 PM
 

WSS 3.0 & MOSS: Usando una plantilla de sitio para crear un Site Collection! « Pasi??n por la tecnolog??a… said:

Pingback from  WSS 3.0 & MOSS: Usando una plantilla de sitio para crear un Site Collection! « Pasi??n por la tecnolog??a…

September 15, 2008 2:35 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts