Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I basically want to write a server-side or client object model utility (Client object model preferred, but we can run the app on the server if we have to in order to use server side object model) that will create a list item with a specific ID, and thus make it so all new items created afterward have IDs larger than the one I've created. Is this possible, and how do I do it?

For more information on what I'm trying to accomplish, below are my assumptions, which might be wrong ...

1) We want to migrate some data from SP2007 to SP2010. We intend to use DocAve to do it.

2) DocAve only exists on production, so we haven't had a chance to test it. From what we hear, it works great. But if IDs in the old list conflict with IDs in the new list, then the IDs are re-assigned. This will break the lookup lists. Because the systems will have to be live before we can start migration, this might be an issue. (Is this an issue, or does DocAve deal with this, and I'm finished?)

3) So, we figure that we can fix that by deploying, and then setting the minimum ID of the new list so that it's higher than the highest ID in the old list. (I assume this will work?)

4) I want to write a utility to do this, so we can easily apply the solution to multiple projects. I want to just point to a list, give an ID number, and create a listitem with that ID number, making it so all items that are created afterward will have a higher number. (Can't figure out how to specify an ID in code though)

So, does anyone have experience with this? Are my assumptions correct? How would you solve this problem?

share|improve this question
    
Have you actually ASKED DocAve? –  Ryan Sep 21 '12 at 9:39
    
No, because that's not the purpose of this post. I suspect that you're right, and DocAve will probably just deal with the data the way we want, since it costs money, and keeping lookup list integrity seems like a pretty basic feature. But I was tasked with coming up with a way of avoiding data conflicts if needed, and I had figured that setting the ID of a new item would be easy. So I'm focusing on whether or not that's possible, regardless of whether it's a moot point. I have been arguing at work that it's a moot point unless DocAve doesn't work. Doesn't seem to matter. They want a Plan B. –  Craig Sep 21 '12 at 13:23
    
So just forget about the whole DocAve thing. I want to know about specifying IDs in code. –  Craig Sep 21 '12 at 13:25
    
Your question is hardly clear Craig - you've mentioned DocAve 3 times so far on this page - clear concise questions tend to get accurate answers. –  Ryan Sep 21 '12 at 19:58
add comment

1 Answer

I don't think it's easy to update IDs of items, but it at least be possible to inject items with the correct ID.

I know this because the Content Deployment Wizard on CodePlex is able to keep the old IDs. Perhaps consider using this tool to do your actual migration to preserve them?

share|improve this answer
    
ID is a read only value but using the tool you mentioned or the Content Deployment and Migration API you can preserve the existing ones as you mention. blogs.technet.com/b/stefan_gossner/archive/2007/08/29/… –  Robert Kaucher Sep 20 '12 at 13:29
    
Nice read, thanks for the link Robert. Also thanks to @chris-obrien-mvp for his great tool :) (I think it's his) –  eirikb Sep 20 '12 at 13:37
    
Well, if these migration apps do what we want, then hopefully DocAve will too. If not, I think the solution will be to create a for-loop that just keeps adding list items, and deleting them, until the ID gets to the number that I want. It'll be time-consuming, but it'll get it done. –  Craig Sep 20 '12 at 16:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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