I have a solution that copies all the content of SharePoint lists to a file, and then copies the content of the file back onto SharePoint (used for backups and stage / live environment switches).
Now I can copy all the fields I need except for one : ID
I understand that it is a read only field, but some other read only fields can be updated (Created, Author, Modified, Editor, _ModerationStatus and _ModerationComments from what I have tested)
I can't use the CopyTo method because I cannot access the destination list.
I want to be able to keep the IDs because I don't want to break all the http://siteCollection//Lists/Posts/Post.aspx?ID=... URLs that appear all over the content of my website.
So basically, the system I have now (which pushes everything besides the ID) works well, as long as nothing gets deleted from the list. When something gets deleted (say ID = 1) the first item becomes ID=2 and when I push it in the empty destination list, it becomes ID=1.
Is there a way to force an ID for a SPListItem? It would almost definitely be a hack, but maybe someone has a way?
Thanks!