I want to copy a list (as it is with the same properties/metadata) from Sharepoint Online to another list in another tenant.

I want to also copy all the properties and metadata of each item.

I'm using C# and CSOM


The easiest is to save the list as a template with content and download the file, re-upload it as a template in the new destination

| improve this answer | |
  • 1
    Can you please attach some details about how to sava list as a template and then upload it? – Robert Lindgren May 6 '15 at 9:03
  • can i have code plz , and in case of library , i should save all file in my pc !!! is thre another solution? – Khaw'la Karray May 6 '15 at 9:42
  • this procedure is done via the interface – susan May 6 '15 at 9:44
  • i want to do it via my application (windows form , c#) – Khaw'la Karray May 6 '15 at 11:11

you may use SharePoint API and C# to do this and you may refer to the below link as a reference

Part 1: Copy a SharePoint List Programmatically

Here's the code:

// Instantiate web instances
SPSite sourceSite = new SPSite(@"http://SharePointServer:31001");
SPWeb sourceWeb = sourceSite.RootWeb;
SPSite destSite = new SPSite(@"http://SharePointServer:31002");
SPWeb destWeb = destSite.RootWeb;

// Get a reference to the source list
SPList sourceList = sourceWeb.GetList("/Lists/Announcements");

// if the list exists on the destination site, delete it
   SPList temp = destWeb.Lists[sourceList.Title];
catch { }

// create new list on the destination web with same properties
Guid newListID = destWeb.Lists.Add(sourceList.Title, sourceList.Description,
SPList destList = destWeb.Lists[newListID];

// copy items
foreach (SPListItem item in announcements.Items)
   SPListItem newDestItem = destList.Items.Add();
   foreach (SPField field in sourceList.Fields)
      if (!field.ReadOnlyField)
      newDestItem[field.Id] = item[field.Id];

// set quicklaunch settings
destList.OnQuickLaunch = sourceList.OnQuickLaunch;
| improve this answer | |

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.