Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Creating a Site Collection with a custom Site Template
August 03
Creating a Site Collection with a custom Site Template

One of my coworkers, John Ross, recently asked me if it was possible to create a new Site Collection in SharePoint 2010 and use a custom site template for it. I'm usually more of a server and infrastructure guy, but this made me curious. In SharePoint 2007 site (really web) templates were saved as .STP files. Those STP files could be in the site collection gallery, or the farm gallery. If it was in the farm gallery then it was available at site collection creation. In SharePoint 2010 site (really web) templates are stored as user solutions in the site collection solution store as WSP files. Those WSP files don't upload at the farm level (at least not that I've been able to find). So how does one create a new site collection with a custom template? Stick around, we're going to find out. J

The first thing to keep in mind is that site collections don't have templates, webs do. When a new site collection is created there is a template picker. That doesn't apply a template to the site collection itself, but to the rootweb of that site collection. When the site collection is created, the rootweb is also created. That is where the template is applied. Knowing that, we can figure out a solution. We know that the site collection gets created, with or without a template. If the site collection is created, then so is its solution gallery. If we upload our WSP to that solution gallery, then it's available to us when we create the rootweb. That's how we create a site collection with a custom template. Here's the blow-by-blow on how to do it.

First we'll save out our site (really web) template. Start by going to the site you want to save as a template. Then go to Site Actions > Site Settings. It will look like this:

When you click "Save site as template" you see this screen (though it won't be filled out, you have to do that)

If things go well, you'll get this screen. Click the link to go to the Solution Gallery.

That should take you to this page:

Click the name of the template you created. You'll be greated with this dialog to save it to your local file system:

Now go into Central Administration and create the Site Collection (Application Management > Create site collections) you want to apply this template to. On the creation page go to the custom template page like below:

The secret sauce is not selecting a template for the rootweb. When the site collection is created, you'll be given a link to it. When you click it you'll be taken to the template picker page, if you hit it as one of the site collection administrators. At the bottom is a link to your newly created site collection's solution gallery.

Upload the template solution here:

Don't forget to activate it.

When you're back to the solution gallery use the breadcrumb to get back to the rootweb of the Site Collection:

That will take you back to the template picker page. Now on the Custom tab we have our template.

That's all there is to it.

tk

Comments

Land Baron! (Take a guess with my name)

Awesome Todd! Nice post.
 on 8/3/2010 6:21 PM

Excellent post with clear instructions

Well done as always!

Craig Pilkenton
 on 8/4/2010 12:04 PM

Re: Creating a Site Collection with a custom Site Template

I've been doing this same thing... Except we added the step of doing the add and install sp-solution at the top of the server so we don't up load to each new site.  But... we do have to activate the solution as a feature whn the new, untemplated site is created.

Problem with this whole mess is when you need to 100's of sites based on this solution.

But...we're starting to eyeball what it will take to do that with powershell.

j.c.
 on 8/4/2010 12:23 PM

Re: Creating a Site Collection with a custom Site Template

J.C.
You could use PowerShell to pretty easially walk through some or all of your webs and turn on a feature.

tk
Todd O. KlindtNo presence information on 8/4/2010 1:44 PM

SharePoint Saturday

Todd - tried to find an e-mail for you but no luck, hopefully you see this. Minneapolis SharePoint Saturday scheduled for October 3, 2010. If you would like to know more and possibly present, send me an email: paul.grafelman{at}rbaconsulting.com. We met breifly at Tech-Ed in New Orleans.
 on 8/6/2010 10:25 AM

Can this be done with a publishing site?

I've been trying to get this to work with a publishing site (saved via the URL since they are not supported as templates) but I seem to be stuck.  I was getting errors for missing feature dependencies but activating those features in the Site Collection Features page got me past those errors.  I now get a generic error but I'm unable to figure out the cause.  Any thoughts on if this can even be done for a publishing template?

Thanks,
ab
 on 8/9/2010 4:41 PM

programmatically

does anyone know how to do this using the api.. i would like to use a workflow to create a site collection, then upload the solution and activate it so the root web is based on the web template.

 on 8/11/2010 6:56 AM

Re: SharePoint Saturday

Hey Paul,
Not sure if I'm going to be at Minneapolis or not. If I do, I'll post it here.

tk
Todd O. KlindtNo presence information on 8/14/2010 10:50 AM

pls clarify on this

Hi to all,
I have restored the sharepoint 2007 DB into Sharepoint 2010. And the sites are opening fine, but am unable to save a subsite as template in sharepoint 2010.

As in sharepoint 2007 it is of .stp files, the same cannot be used in sharepoint 2010 were its of .wsp files.

Please clarify on this!
 on 9/20/2010 4:40 AM

Very great post!! Very helpful

You're man... This post is really help me. Thanks Todd. Oh ya, you can see this blog too <<blatant spamming link removed>> . I see thre are many information about Sharepoint 2010. Sometimes it helps me too.
 on 9/23/2010 9:24 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit