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

Publishing SharePoint List InfoPath Form to a new location

Needed to move it from Dev to Production. File > Publish > Export Source Files. Close InfoPath Go to folder where Source Files are saved, open Manifest.xsf.  Find all instances of the URL and replace them with the new URL - there should be five. If you have secondary data connections, update those also. I use Notepad++ and “replace all” so it just takes a second.  Save the manifest.xsf file and close. Now right click on the manifest.xsf and select Design to open it back up in InfoPath.  Click on File >Publish and verify the URL is correct in the “Publish form to a SharePoint List” section”.