środa, 23 maja 2012

How to find out what is the site template?

First, run the Power Shell script:

$web = Get-SPWeb <Site URL>
write-host "Web Template:" $web.WebTemplate " | Web Template ID:" $web.WebTemplateId
$web.Dispose()


You now know the site template name and id. But to know the template title, as you see it when creating a new site from web interface, run this command:


Get-SPWebTemplate | Sort-Object "Name"


Here is a list of most popular site templates:


Site Definition                                                 
Site Template Name & ID
Team Site                                           
STS#0
Blank Site
STS#1
Document Workspace
STS#2
Blog
BLOG#0
Group Work Site
SGS#0
Visio Process Repository
VISPRUS#0
Basic Meeting Workspace
MPS#0
Blank Meeting Workspace
MPS#1
Decision Meeting Workspace
MPS#2
Social Meeting Workspace
MPS#3
Multipage Meeting Workspace
MPS#4
Assets Web Database
ACCSRV#1
Charitable Contributions Web Database
ACCSRV#3
Contacts Web Database               
ACCSRV#41
Issues Web Database
ACCSRV#6
Projects Web Database
ACCSRV#5
Document Center
BDR#0
Records Center
OFFILE#1
Business Intelligence Center
BICenterSite#0
My Site Host
SPSMSITEHOST#0
Personalization Site
SPSMSITE#0
Enterprise Search Center
SRCHCEN#0
Basic Search Center
SRCHCENTERLITE#0
FAST Search Center
SRCHCENTERFAST#0
Enterprise Wiki
ENTERWIKI#0
Publishing Portal
BLANKINTERNETCONTAINER#0
Publishing Site
CMSPUBLISHING#0


Export / Import site, list or document library

To export a site, list, or document library, you can use either Windows PowerShell or Central Administration. But to import them, you can use only Windows PowerShell. So let's focus on the Power Shell.

Export command:
Export-SPWeb -Identity <Site URL> [-ItemUrl <Object URL>] -Path  <Export file name> [-IncludeUserSecurity] [-IncludeVersions] [-Force <True|False>] [-NoFileCompression] [-Verbose]
Import command:
Import-SPWeb -Identity <Site URL> -Path <Export file name> [-Force] [-NoFileCompression] [-Verbose]
-Force overwrites the export package if it already exists. During import use it to overwrite the list or library that you specified.

-NoFileCompression disables file compression in the export package. The export package is stored in the folder then. Use this parameter for performance reasons. If you used this option when exporting,  you have to specify it during import  as well.

-Verbose is used it to view the progress of the operation.

The site that you are importing to must have a template that matches the template of the exported!


Here you can read how to find out what is the site template?

The site that you are importing to must have the same default language as the exported site!