[SalesForce] Migrating FeedComments and FeedItems

Due to a large data migration which involves moving records from one object to another, I am currently migrating Chatter feeds from one record to another. I am using a method which was told to me by some great members on here. I put it into instructions in case anybody needs it. I'm sure this is old knowledge to many of you but I just thought it would be good to have on this site anyway. (thank you @sfdcfox and @dunc44 with all this)

How to migrate a master record and its Feed data to a new object through DataLoader :

  1. Create a new External ID field in the destination Object named OrigRecordID__c
  2. EXPORT master records to a .csv file (OrigMasterRecs.csv)
  3. INSERT OrigMasterRecs.csv file into destination Object, and map the OrigRecordID__c field in destination Object to the RecordID column in the spreadsheet
  4. EXPORT the newly inserted records to a new file (NewMasterRecs.csv)
  5. EXPORT FeedItems from original Object using the
    OriginalObjectName__Feed object found in DataLoader after clicking
    Show All Salesforce objects checkbox
  6. Create a NewParentID column in OrigFeedItems.csv
  7. Do a VLOOKUP mapping from the ParentID column in OrigFeedItems.csv
    to the OrigRecordID column of the NewMasterRecs.csv spreadsheet and
    pull the corresponding value in the RecordID column of that
    NewMasterRecs.csv file and put those values into the NewParentID
    column of the OrigFeedItems.csv file.
  8. INSERT OrigFeedItems.csv, and map ParentID field of FEEDITEM object
    to the NewParentID column

This method works very well. However, I have come across a problem moving the feed Comments (FeedComments) to their proper new FeedItem parents in the new master records. It should be a case of just repeating the above process since it's just a matter of moving more master records with their detail records. However, unlike the above method I am unable to create a field (OrigRecordID__c above) to use in a VLOOKUP in order to map the old FeedItem recordID to the new PARENTID because the FeedComment object is not accessible to put a new field into.

Does anybody know of a way around this ? Is there a way to access the FeedComment object in order to put a new field into it ? I tried using Eclipse, but that would not work. Anybody have any ideas on a possible other method…?

Thank you for all your help.

Best Answer

What do you mean by the FeedComment object is not accessible. You should be able to access it.

In an execute anonymous window try this

 list<FeedComment> fComments = [Select Id, FeedItemId, CommentType, CommentBody From FeedComment limit 25];
 system.debug(fComments);

What results do you get.

You should be able to extract the feedComment objects and reparent them in the same way that you have described above. Where exactly are you hitting an error?

Related Topic