Is it possible to export a Sharepoint 2010 list while on a 2013 Sharepoint Server? I want to be able to export the contents from a list on a 2010 site into a csv file, then import it into a list on a 2013 site using PowerShell.
When running the script, I receive a :
Get-SPWeb : Cannot find an SPSite object that contains the following Id or Url:" error.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Web
$web = Get-SPWeb -identity "http://www.test2010.com/site/"
#Get the Target List
$list = $web.Lists["My List"]
#Array to Hold Result - PSObjects
$ListItemCollection = @()
#Get All List items where Status is "In Progress"
$list.Items | Where-Object { $_["ID"] -ge 1} | foreach {
$ExportItem = New-Object PSObject
$ExportItem | Add-Member -MemberType NoteProperty -name "Title" -value $_["Title"]
$ExportItem | Add-Member -MemberType NoteProperty -name "ID" -value $_["ID"]
#Add the object with property to an Array
$ListItemCollection += $ExportItem
}
#Export the result Array to CSV file
$ListItemCollection | Export-CSV "c:\ListInfo.csv" -NoTypeInformation
#Dispose the web Object
$web.Dispose()