Skip to main content

Powershell commands

Subsite level site export / import commands

Go to Command Prompt and go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
export the below sites using stsadm. Commands are below

stsadm -o export -url http:****/sites/test/newsite -filename d:\test.cmp -includeusersecurity -versions 4 -nofilecompression

stsadm -o import -url http://****/sites/test/newsite -filename d:\test.cmp -includeusersecurity -updateversions 2 -nofilecompression

Unless you’re running a signed script, make sure you to set the correct execution policy using

Set-ExecutionPolicy. To allow local scripts to run unsigned, run:
Set-ExecutionPolicy Unrestricted

Importing List
Import-SPWeb –Identity http://****/sites/test/ImportListTest -Path D:\testbkp\ListBackup211212\ListBackup211212.cmp -includeusersecurity –force

Export Subsite:

export-spweb -identity http://mysite/mysubsite  -path D:\subsitebackup\mysubsitebackup.cmp

 Import Subsite:

import-spweb -identity http://mysite/mysubsite  -path D:\subsitebackup\mysubsitebackup.cmp

Comments

Popular posts from this blog

Differences between Windows SharePoint Services (WSS) and Microsoft Office SharePoint Server 2007 (MOSS)

WSS is included as a part of the Windows Server 2003 whereas MOSS is a separate product.WSS doesn’t have its own licensing model, it is controlled through Windows Server licenses whereas MOSS has it own licensing model that includes both Server-Side as well as client accesses licenses. MOSS includes all the features of WSS and adds its own set of components as services. Additional features that are part of MOSS includes Collaboration Social networking web parts – Colleague Web Part, Colleague Tracking Web Part, In Common Web Part etc. Enterprise search Enterprise content sources Files shares, Web sites, SharePoint sites, Exchange Public Folders, and Lotus Notes databases, more relevant results, people search, business data search.