SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

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.


Posted 04-21-2008 9:37 AM by dwollerman

Comments

Sharad wrote re: Using a Site Template (STP File) to create a site collection
on 04-21-2008 7:58 PM

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?

Robin wrote re: Using a Site Template (STP File) to create a site collection
on 04-22-2008 3:41 AM

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

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 04-22-2008 6:44 AM

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.

Nicki wrote re: Using a Site Template (STP File) to create a site collection
on 04-22-2008 9:25 AM

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

desktop publishing quotes wrote desktop publishing quotes
on 05-01-2008 4:16 AM

Pingback from  desktop publishing quotes

Olivier wrote re: Using a Site Template (STP File) to create a site collection
on 05-28-2008 8:31 AM

I got the same problem as decribed by Sharad.

Any solution / fix?

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 05-28-2008 8:41 AM

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)

Peter wrote re: Using a Site Template (STP File) to create a site collection
on 06-11-2008 1:31 PM

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.

Paul wrote re: Using a Site Template (STP File) to create a site collection
on 07-30-2008 5:17 AM

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.

Kelly wrote re: Using a Site Template (STP File) to create a site collection
on 08-07-2008 4:59 PM

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

Sudha wrote re: Using a Site Template (STP File) to create a site collection
on 08-08-2008 1:56 AM

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

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 08-10-2008 4:00 PM

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.

Ian wrote re: Using a Site Template (STP File) to create a site collection
on 08-22-2008 1:08 AM

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.

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 08-22-2008 6:51 AM

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.

Ian wrote re: Using a Site Template (STP File) to create a site collection
on 08-25-2008 7:31 PM

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?

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 08-26-2008 7:26 AM

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.

Blog del CIIN wrote WSS 3.0 & MOSS: Usando una plantilla de sitio para crear un Site Collection!
on 09-15-2008 2:21 PM

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

WSS 3.0 & MOSS: Usando una plantilla de sitio para crear un Site Collection! « Pasi??n por la tecnolog??a… wrote WSS 3.0 & MOSS: Usando una plantilla de sitio para crear un Site Collection! « Pasi??n por la tecnolog??a…
on 09-15-2008 2:35 PM

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

Rajeev Tonde wrote re: Using a Site Template (STP File) to create a site collection
on 01-20-2009 5:11 PM

Hi Dave,

Is is possible to not use STSADM to install the template. Our Admin does not allow us to save/install template on Global/Farm level. Is is possible for me to save the template within my sote collection and then use that template to create sub site??

Thanks

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 01-21-2009 11:52 AM

using the site template within a site collection is how it works by default when you create a site template. When you create a site template, the file will be saved into the site collections site template gallery. At this point it is only able to be used within the site collection to create sub sites at any level throughout the site collection.

nickowell wrote re: Using a Site Template (STP File) to create a site collection
on 06-04-2009 3:06 PM

What is wrong when I do not get any Custom Tab. Uploading stp files works fine, but they do not show up under Custom templates tab since I do not have that tab???

Confused!

dwollerman wrote re: Using a Site Template (STP File) to create a site collection
on 06-08-2009 7:57 PM

Nickowell,

Usually the site templates in the site template gallery will show up under custom, and should do the same by adding the global site template gallery. Is it showing up under any other tab?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.