Populating comments using web service

Topics: Enhanced Blog Edition
May 18, 2010 at 3:07 PM
Edited May 21, 2010 at 2:17 PM


I'm in the process of converting a blog into sharepoint. The source blog is Movable type, i've exported the data and loaded it into a vs2008 project, where it's now stored in a class, all still linked together internally (posts/comments etc)

I've managed to populate the posts list via web services on the sharepoint side, using the UpdateListItems method. This has worked perfectly and i've migrated all the posts. Now, when I come to migrate the comments, I need to populate the "post id" field on the comments list in sharepoint, to tie the comments back to the post. I'm having trouble with this, as it doesn't appear to populate using the following CAML:

       <Method ID='1' Cmd='New'><Field Name='Body'>body text</Field><Field Name='PostID'>1234</Field></Method>

This works, and inserts a row, only the PostId field is empty. So I end up with lots of orphaned comments which aren't attached to a post. If I create a manual comment against one of my imported blog entries, it correctly populates the PostID field.

If I change the Field Name to be Post_x0020_Id or other derivatives, it doesnt insert and reports:

0x81020014One or more field types are not installed properly. Go to the list settings page to delete these fields

which generally means one of the specifield CAML fields is wrong.

...So.. if I can get the insert to work, why isn't it showing properly? Am i understanding the list relationships correctly?

This is the final piece to the puzzle and without it my blog migration stops dead... can anyone help? I'm hoping so!

EDIT: looking further into it, it may be that I need to populate the lookup field "PostTitle" on the comments list which links back to the Posts list.... currently investigating the population of lookups via CAML ;)




May 21, 2010 at 2:20 PM

unfortunately this project appears to be dead, at least nobody responded to my question.

for clarity, this is how i formed the caml for the updatelistitems method:

<Field Name='Categories' Type='Lookup'>8;#Advertising;#9;#Animation;#</Field>

Jul 13, 2010 at 4:15 PM
Edited Jul 13, 2010 at 4:34 PM

If you look at the Schema.xml under Out-Of-Box Site Templates feature, Post Id is a read only field.  The way to make it work is to submit Post Title (remember it is a lookup value so you have to use xml elements corresponding to SPFieldLookupVlaue) instead of submitting Post Id.

Aug 2, 2010 at 3:09 PM

for completeness, I now have a custom written tool which will take a movable type blog export (generated from the MT admin panel), query a target sharepoint blog site and load the data automatically (including categories, comments, etc). If you should need such a tool, drop me a message.

I've used this to migrate 2 large Movable type blogs into CKS:EBE blogs for my employer, who is now very happy (after being told it couldn't be done by MT themselves!)


Aug 26, 2010 at 1:27 PM

...and i've dumped the tool, MT2SP, into a codeplex project, free for all to use