0

TL;DR - Old SharePoint List with circa 9k List Items, each with about 50 columns, Exported to Excel, needs to go into a new/live list which is essentially within the same context (it carries out much the same functions as the old one did) - The new list has already been created, has associated workflows and is in production (so I cant import to SharePoint as a new list from excel)

I have inputted en-masse to a list before using the "edit this list" table view, copy-paste from excel etc. but this will not work in this case (i have already tried it) - the volume of data is too extensive and crashes IE or bombs out the session.

The other problem also is that while the majority of columns match the new list, some do not, so there has to be a bit of data manipulation to get them to match up.

Not sure what the best way to approach this is, any suggestions? - I would be very grateful.

SharePoint 2016 On-Prem, SQL Server 2016

Old List is coming from SharePoint 2013.

I am the on-site SharePoint Admin so have full server/database access

Thank you!

Rob

  • Hey Rob, do you have server access? – Ornery Walrus Oct 5 '17 at 10:18
  • Hey! - yes, sorry should have clarified this. I am the onsite SharePoint Admin so i have full server/database access. – Rob Oct 5 '17 at 10:20
  • Yea, I'm thinking the same thing as Ornery. Powershell to the rescue. – Jack Oct 5 '17 at 10:41
0

Since you have server access, I'd go with a PowerShell solution. Something like the following should work for you if you can export the current list to csv:

Add-PSSnapin Microsoft.SharePoint.Powershell
$file = Import-Csv -LiteralPath "C:\list.csv"
$web = Get-SPWeb "http://server/site/web"
$list = $web.Lists["List Title"]
ForEach ($row in $file) {
    $item = $list.Items.Add()
    $item["prop1"] = $row.prop1
    $item["prop2"] = $row.prop2
    (...)
    $item["prop50"] = $row.prop50
    $item.Update()
}

If all the columns to set are text values, you could rename the CSV headers to the new list's internal field names, and loop the properties portion as well:

ForEach ($row in $file) {
    ForEach ($prop in $row) {
        $item[$prop] = $prop
    }
    $item.Update()
}

Hope this helps - good luck!

  • Thank you! - this seems to be the best solution! - I do appreciate it. Just so I am clear on it, I presume the $item["prop1"] is the name of the internal list column and the $row.prop1 is the name of the column in the CSV file? - I tested it yesterday and it created multiple items but it did not pick up all the columns. Do I need to specify each one in this script? thank you! – Rob Oct 10 '17 at 8:46
  • Hey Rob, that's absolutely correct. The prop1 in $item["prop1"] is the field internal name on the list, and the prop1 in $row.prop1 is the corresponding column in the csv file. You will need to specify each column, and ensure you're setting the values correctly. – Ornery Walrus Oct 11 '17 at 18:57
0
  1. Did you try to Create the list as template including data, and restore it in the new location? It would probably fail due to the size, but I wanted to be sure that you tried that first and foremost :)

  2. You can use the CSOM library in C# or PowerShell. The code will be quite straight forward and the actual migration will be relatively fast since this is a custom list with raw data and not a document library with documents.

  3. If you are not confident with development, perhaps you could look into using Sharegate (the Trial version could be sufficient since you only need it in 1 case). I never heard of anyone using it for custom lists, but if it works for document library, I am guessing it would work for lists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.