locked
Moving Discussion Items from one site collection to another site collection RRS feed

  • Question

  • We are using the Community Site template in a Knowledgeshare portal and have several Community  Site Collections for different business divisions.  There are instances when a discussion item is posted in the wrong Communisty Site Collection. 

    This is the current manual proces that users are following:

    copying/pasting as there is no tool available to move things between communities L; I apply the following logic normally:

    • When it is no or 1 reply,  I copy the start of the discussion thread and then the reply as a separated reply with a message “Reposted on behalf of @.....<original author>” (the @ will open the address book and makes the name “hyperlinked”)
    • When there are more replies, I copy the whole thread and create one discussion with the whole thread. Again started with “Reposted on behalf of @.....<original author>”. I do clean up some of the non-discussion related stuff in between like “Like  Reply …” as these links will only give an error.

    Is there a better process or tool for moving discussion items and replies from one site collection to another?

    Wednesday, October 28, 2015 1:18 PM

Answers

All replies

  • here is a script that moves the discussion to another list:

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    
    $web = Get-SPWeb "http://TeamSite"
    $sourceList = $web.GetList("http://TeamSite/Lists/source/")
    $destinationList = $web.GetList("http://TeamSite/Lists/destination/")
    
    #Get desired discussion by Name (or use some other identifier eg. ID)
    $sourceDiscussion = $sourceList.Folders | Where-Object {$_.Name -eq "My cool subject"}
    
    #Add new discussion to destination list
    $destinationDiscussion = [Microsoft.SharePoint.Utilities.SPUtility]::CreateNewDiscussion($destinationList.Items, $sourceDiscussion.Title)
    #Copy basic field values (you can copy some custom fields if needed)
    $destinationDiscussion["Body"] = $sourceDiscussion["Body"]
    $destinationDiscussion["Author"] = $sourceDiscussion["Author"]
    $destinationDiscussion["Editor"] = $sourceDiscussion["Editor"]
    $destinationDiscussion["Modified"] = $sourceDiscussion["Modified"]
    $destinationDiscussion["Created"] = $sourceDiscussion["Created"]
    #Add discussion
    $destinationDiscussion.SystemUpdate($false)
    
    #Get all discussion messages (maybe there is better way to get it but this works)
    $caml='<Where><Eq><FieldRef Name="ParentFolderId" /><Value Type="Integer">{0}</Value></Eq></Where>' -f $sourceDiscussion.ID
    $query = new-object Microsoft.SharePoint.SPQuery
    $query.Query = $caml
    $query.ViewAttributes = "Scope='Recursive'";
    $sourceMessages = $sourceList.GetItems($query)
    
    foreach ($sourceMessage in $sourceMessages) {
        #Add new message to discussion
        $destinationMessage = [Microsoft.SharePoint.Utilities.SPUtility]::CreateNewDiscussionReply($destinationDiscussion)
        #Copy basic field values (you can copy some custom fields if needed)
        $destinationMessage["Body"] = $sourceMessage["Body"]
        $destinationMessage["TrimmedBody"] = $sourceMessage["TrimmedBody"]
        $destinationMessage["Author"] = $sourceMessage["Author"]
        $destinationMessage["Editor"] = $sourceMessage["Editor"]
        $destinationMessage["Modified"] = $sourceMessage["Modified"]
        $destinationMessage["Created"] = $sourceMessage["Created"]
        #Add message
        $destinationMessage.SystemUpdate($false)
    }


    Wednesday, October 28, 2015 3:16 PM
  • Thank you for hte prompt response! 

    However, we are looking for a non-script related process or tool as the Moderators of the Discussion lists do not have this level of skillsets.

    Wednesday, October 28, 2015 5:27 PM
  • You create a template you have the option of including the existing content (Save List As Template > Include Content). When you move the template to the other site collection and create a new list based on it then your data will be there.

    You can also do this using SharePoint Designer - select the list, select Copy then find destination and select Paste.

    Another option is- STSADM extensions such as gl-exportlist and gl-importlist

    PS script to do this: http://sharepoint.stackexchange.com/questions/8600/moving-a-discussion-from-a-discussion-board-to-another

    Moreover, If you wish you may also try this SharePoint migration solution to move discussion Items from one site collection to another site collection.

    Hope this helps!

    Thursday, October 29, 2015 7:40 AM