{"id":4911,"date":"2016-08-19T04:43:09","date_gmt":"2016-08-19T04:43:09","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=4911"},"modified":"2016-08-19T04:43:09","modified_gmt":"2016-08-19T04:43:09","slug":"retain-item-id-while-copying-list","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/","title":{"rendered":"RETAIN ITEM ID WHILE COPYING LIST"},"content":{"rendered":"<div class=\"section the_content has_content\">\n<div class=\"section_wrapper\">\n<div class=\"the_content_wrapper\">\n<h3>Executive Summary<\/h3>\n<p>We have developed a <strong>SharePoint Content Migration Tool<\/strong> using Client Side Object Model which has various options including copy of lists from one site collection or sub site (from any SP version (SP 2010, SP 2013, SP 2016) to another site collection or sub site presents in another farm or same farm (to any SP version (SP 2010, SP 2013, SP 2016).<\/p>\n<h3>ISSUE<\/h3>\n<p>For copying list our client has included various options. Among them one option was to retain item id. If one item in source list has id 5 then in destination list id of item should be 5.<\/p>\n<p>As we know ID field of list is read-only, auto generated and auto incremented field. Whenever an item has added to list ID of new item assigned automatically and it is greater than 1 of previously created item.<\/p>\n<h3>SOLUTION<\/h3>\n<p>To resolve above issue we have found one solution which was described below.<\/p>\n<ol>\n<li>Store all item ID into a collection or array.<\/li>\n<li>Sort above collection in ascending order so that lowest id should copy first.<\/li>\n<li>Copy first item from source list to your destination list.<\/li>\n<li>Check item ID of source list is equal to Item ID of destination list.<\/li>\n<li>If same then continue with second item.<\/li>\n<li>If ID is not same then delete exactly N no of items where N is the difference between source item id and destination item id.\u00a0If Item ID of destination list item is 5 and ID of source list item is 2.Then N= (5-2)-1<\/li>\n<li>You can get step by step process of <a href=\"http:\/\/blog.softreeconsulting.com\/sharepoint\/retain-item-id-while-copying-item-from-one-list-to-another-list\/\">Retain Item ID from this link<\/a>.<\/li>\n<\/ol>\n<p>About the Client:<br \/>\nClient: SharePoint Solution Provider<br \/>\nLocation: USA<br \/>\nIndustry:\u00a0IT<br \/>\nTechnologies Used:\u00a0SharePoint, Office 365, Client Object Model<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"section section-post-footer\">\n<div class=\"section_wrapper clearfix\">\n<div class=\"column one post-pager\"><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Executive Summary We have developed a SharePoint Content Migration Tool using Client Side Object Model which has various options including copy of lists from one site collection or sub site (from any SP version (SP 2010, SP 2013, SP 2016) to another site collection or sub site presents in another farm or same farm (to any SP version (SP 2010, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4911","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RETAIN ITEM ID WHILE COPYING LIST - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RETAIN ITEM ID WHILE COPYING LIST - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"Executive Summary We have developed a SharePoint Content Migration Tool using Client Side Object Model which has various options including copy of lists from one site collection or sub site (from any SP version (SP 2010, SP 2013, SP 2016) to another site collection or sub site presents in another farm or same farm (to any SP version (SP 2010, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-19T04:43:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RETAIN ITEM ID WHILE COPYING LIST - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/","og_locale":"en_US","og_type":"article","og_title":"RETAIN ITEM ID WHILE COPYING LIST - Softree Technology","og_description":"Executive Summary We have developed a SharePoint Content Migration Tool using Client Side Object Model which has various options including copy of lists from one site collection or sub site (from any SP version (SP 2010, SP 2013, SP 2016) to another site collection or sub site presents in another farm or same farm (to any SP version (SP 2010, [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/","og_site_name":"Softree Technology","article_published_time":"2016-08-19T04:43:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"RETAIN ITEM ID WHILE COPYING LIST","datePublished":"2016-08-19T04:43:09+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/"},"wordCount":280,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/","url":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/","name":"RETAIN ITEM ID WHILE COPYING LIST - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"datePublished":"2016-08-19T04:43:09+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/uncategorized\/retain-item-id-while-copying-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"RETAIN ITEM ID WHILE COPYING LIST"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/4911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=4911"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/4911\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=4911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=4911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=4911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}