.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Working with Site Templates in MOSS 2010

Posted By:ravi m       Posted Date: February 21, 2011    Points: 25    Category: SharePoint    URL: http://www.dotnetspark.com  

This article explains how to create site template solutions, deploy them

1.     Introduction to Site Templates:


Site templates as the name suggests contains pre-defined lists, web parts, files, features or other settings that can be used to create a new site collection. Out of the box (OOB), MOSS 2010 comes with site templates of its own. Templates are classified under 5 different categories







Team Site

Basic Meeting Workspace

Document Center

Publishing Portal

Templates deployed by user

Blank Site

Blank Meeting Workspace

Records Center

Enterprise Wiki


Document Workspace

Decision Meeting Workspace

PowerPoint Broadcast Site




Social Meeting Workspace

Business Intelligence Center



Group work Site

Multipage Meeting Workspace

Enterprise Search Center



Visio Process Repository


My Site Host





Basic Search Center





FAST Search Center




User can choose any template according to the requirement from the above templates available to create a site. In MOSS 2007, user could save the site template as STP file and deploy the template in the farm. But MOSS 2010 saves the site template as a WSP solution. As you may be aware that STP files are deprecated in MOSS 2010, you cannot use STP files to create sites in MOSS 2010.

2.     Migration:

 Here I am not going to explain the migration because it is too big to be covered for the scope of this document. There are two ways to upgrade from MOSS 2007 to MOSS 2010.

Ø  In place Upgrade

Ø  Attach Content DB upgrade


Below are the steps to be followed when going for attach content DB approach.

1.       Check Prerequisites

From the MOSS product disc or MOSS installation source, run "PREREQUISITEINSTALLER.EXE"

Ensure that everything in the table below is available on the target farm servers.

Ref: http://technet.microsoft.com/en-in/library/cc262485(en-us,office.14).aspx

2.       Install any prerequisites as suggested by the step 1

3.       Install MOSS 2010 on all the servers in the FARM

4.       Run Product and Technology Wizard on All Servers and make sure Central Admin Site is up.


5.       Migrate the existing MOSS 2007 Content DB

Restore the content dB to the new SQL Server. Open the powershell command promopt and run the following command

stsadm -o addcontentdb -url "Enter the url"  -databasename  "Content DB Nane"  -databaseserver  "NEWDBSERVER" -preserveolduserexperience true


6.       Do a visual upgrade of the site

Once the migration is done, when you browse to the URL, you will find that the look and feel and have not changed. To get the MOSS 2010 look and feel. Do a visual upgrade from the site settings menu. Though you get the MOSS 2010 look and feel, it does not apply the theme or master page or style sheets present in the original one. You will have to manually configure them using Sharepoint Designer.

Note: Just remember that themes have drastically changed. MOSS 2010 uses ".thmx" format while MOSS 2010 used CSS with images.

3.     Create Site template Solution:


Follow below steps to save the site template.

Ø  Go to site settings

Ø  Under Site Actions -> Click Save as Site Template. In that form fill up the fields and check the Include Content checkbox. Click OK.

Ø  Click solution Gallery to find the new solution in there in active state.

Ø  Click on the newly created solution name to save the WSP file to the disk.


4.     Change scope to Farm Level:

In sandboxed environment which is only limited to the site, we can create new site collections within the site by uploading the WSP to the solution gallery. The scope of this WSP is now limited to the site.  But what if we want the templates to be accessible across all the web applications just like the OOB Team Site template! There is no easy way to do that. Here are the steps that I followed to change the scope to farm level.

1.       Open Visual Studio 2010. Click New Project and select project type "Import SharePoint Solution Package". Select the folder where WSP is located and provide a name for the solution and click OK.




2.       Next select the radio button Deploy as farm Solution and click Next.





3.       Provide the path for the existing solution package and click Next



4.       Click Finish to import the solution. It will take a minute or two to finish this task.






5.       Double click  Feature 3 under the solution explorer



6.       Now change the scope from site to Farm in the drop down list. Save the solution.



7.       Go to Build Menu -> Click Package. A farm level WSP will be created in debug/release folder.


5.    Deploy site template solution:

Use stsadm to deploy the solution in the SharePoint farm. Open PowerShell command prompt in administrator mode and run the following commands.


stsadm -o addsolution -filename knowmax.wsp

stsadm.exe -o deploySolution -name knowmax.wsp  -allowGacDeployment -immediate


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

    Read also another Resources from the same Author

Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend