Tuesday, 14 February 2017

How to take the backup of site collection using power shell commands

How to perform farm backup using powershell command?

Backup-Spfarm -Directory "c:\spfarm" -Backupmethod "full" -Force

How to restore farm using powershell?

Restore-Spfarm -Directory "c:\spfarm" -force

How to take the backup of sitecollection using powershell?

Backup-Spsite -Identity "http://technocircle/sites/IT" -Path "c:\sitecollectionbackup\it.bak" -Force

Restore-Spsite -identity "http://technocircle/sites/software" -Path "c:\sitecollectionbackup\it.bak" -Force

How to export subsite using powershell?

Export-Spweb -Identity "http://technocircle/sites/IT/finance" -Path "c:\subsitebackup\finance.cmp" -force

Import-Spweb -Identity "http://technocircle/sites/software/usfinance" -Path "c:\subsitebackup\finance.cmp" -Force