##Backup and then imports a list, watch out for the paths
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://scushp01/IT"
$SourceListURL = "/IT/Lists/SiteLinks"
$BackupPath = "C:\temp\ListB.cmp"
Export-SPweb $SourceWebURL -IncludeVersions All -ItemUrl $SourceListURL -path ($BackupPath) -nologfile -Force
$TargetWebURL = "http://scushp01/HR/Surveys"
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath) -nologfile -UpdateVersions Overwrite
##Backup a list
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://scushp01/sites/Testing/IT/Main"
$SourceListURL = "/sites/Testing/IT/Main/Lists/Links"
$BackupPath = "C:\temp\"
Export-SPweb $SourceWebURL -IncludeVersions All -ItemUrl $SourceListURL -path ($BackupPath + "NetTracking.cmp") -nologfile -Force
##add the main backup site to the main site.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$TargetWebURL = "http://scushp01/sites/Testing/IT/main"
$BackupPath = "C:\temp\ITMainSite\main"
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath + ".cmp") -nologfile -UpdateVersions Overwrite
##Backup a list
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://portal.opwftg.com/sites/OPWSS/HR"
$SourceListURL = "/sites/OPWSS/HR/Team"
$BackupPath = "E:\temp\"
Export-SPweb $SourceWebURL -IncludeVersions All -ItemUrl $SourceListURL -path ($BackupPath + "xx.cmp") -nologfile -Force
##http://technet.microsoft.com/en-us/library/ee428301(v=office.15).aspx
##Export site and then import the site
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Source site
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://portal.opwftg.com/teamsites/it/OCM"
$BackupPath = "E:\temp\TempSave"
$TargetWebURL = "http://portal.opwftg.com/teamsites/it/GD"
Export-SPweb $SourceWebURL -IncludeUserSecurity -IncludeVersions All -path ($BackupPath + ".cmp") -nologfile -Force
#Import the List to Target Web
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath + ".cmp") -nologfile -UpdateVersions Overwrite
##########################################################################
##Backup a list
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://opwshp02/oracle"
$SourceListURL = "/oracle/Lists/Oracle Super Users/Allitems.aspx"
$BackupPath = "E:\temp\TempSave\"
Export-SPweb $SourceWebURL -IncludeVersions All -ItemUrl $SourceListURL -path ($BackupPath + "OracleSuperUsers.cmp") -nologfile -Force
##This also worked for a list
##Backup a list
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##<SiteURL> is URL for the site, list, or library that you are exporting.
$SourceWebURL = "http://portal.opwftg.com/teamsites/it/GD"
$SourceListURL = "/teamsites/it/GD/Lists/R12%20Issue%20Tracker/Open%20Issues.aspx"
$BackupPath = "E:\temp\TempSave\"
Export-SPweb $SourceWebURL -IncludeVersions All -ItemUrl $SourceListURL -path ($BackupPath + "xx.cmp") -nologfile -Force
#############Import the backuped up list#################
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$BackupPath = "E:\temp\TempSave\Intranet"
$TargetWebURL = "http://portal.opwftg.com/sites/OPWSS/Testing/TestLibraryMigration"
import-spweb $TargetWebURL -IncludeUserSecurity -path ($BackupPath + "OracleSuperUsers.cmp") -nologfile -UpdateVersions Overwrite