This SharePoint tutorial explains SharePoint online copy list items to another list programmatically. We will see how to CSOM SharePoint to copy list items to another list in SharePoint online.
In this particular example, we will do this inside a console application and we will try to connect to the SharePoint Online site.
To work with .Net managed object model code we need to add below two dlls:
- Microsoft.SharePoint.Client.dll
- Microsoft.SharePoint.Client.Runtime.dll
Copy SharePoint list items to another list
Here I have a list name as SourceList which has 3 columns like below:
- Title (Single line text)
- EmailID (Single line text)
- Address (Multiple line text)
It has few items and the list looks like below:

Here we will move these items to another list in the same site which has same column names.
Below is the code to copy SharePoint list items to another list programmatically using C#.Net.
public static void CopyItemsFromOneListToAnotherList()
{
using (ClientContext ctx = new ClientContext(“https://onlysharepoint2013.sharepoint.com/sites/Bhawana/”))
{
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
ctx.Credentials = new SharePointOnlineCredentials(GetSPOAccountName(), GetSPOSecureStringPassword());
ctx.Load(ctx.Web);
ctx.ExecuteQuery();
List sourceList= ctx.Web.Lists.GetByTitle(“SourceList”);
ctx.Load(sourceList);
ctx.ExecuteQuery();
List destList = ctx.Web.Lists.GetByTitle(“DestinationList”);
ctx.Load(sourceList);
ctx.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = “<View/>”;
ListItemCollection listItems = sourceList.GetItems(camlQuery);
ctx.Load(listItems);
ctx.ExecuteQuery();
foreach (ListItem item in listItems)
{
ListItemCreationInformation newItemInfo = new ListItemCreationInformation();
ListItem newItem = destList.AddItem(newItemInfo);
newItem[“Title”] = item[“Title”];
newItem[“EmailID”] = item[“EmailID”];
newItem[“Address”] = item[“Address”];
newItem.Update();
}
ctx.ExecuteQuery();
}
}
private static string GetSPOAccountName()
{
try
{
return ConfigurationManager.AppSettings[“SPOAccount”];
}
catch
{
throw;
}
}
private static SecureString GetSPOSecureStringPassword()
{
try
{
var secureString = new SecureString();
foreach (char c in ConfigurationManager.AppSettings[“SPOPassword”])
{
secureString.AppendChar(c);
}
return secureString;
}
catch
{
throw;
}
}
Once you run the above code, it will copy the items like below:

Read some SharePoint CSOM examples:
- SharePoint 2016 CSOM Check if Column Exists or Not in SharePoint List
- Upload large files to SharePoint online document library using PowerShell csom
- Delete User Custom Action using CSOM SharePoint Online
- Steps to add items from csv file to SharePoint Online List using PowerShell in CSOM
- How to create and use PowerShell global variable
- How to check file size using PowerShell Script
- the list is too large to save as a template the size of a template cannot exceed 52428800 bytes
- Insert/Add item to SharePoint Online list using PowerShell
- [Solved] cannot complete this action. please try again. SharePoint CAML query
- How to export SharePoint List items to excel using Power Automate and send email
I hope this will be helpful to you to copy SharePoint list items to another list programmatically using CSOM in SharePoint Online/2013/2016.
- copy list items to another list sharepoint online
- copy list items to another list sharepoint 2013
- copy list items to another list c#
- copy list items to another list sharepoint
- sharepoint online copy list items to another list programmatically
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”