Moving blogs post with Attachments using Rest API

We are trying to move blogs posts to a blog in an Archive Group using Rest.  When a blog post contains an attachment, I'm finding that there is a duplicate file created in Te_attachments table and the original attachment is marked as isindexed so it still shows up in Search for the original group.  Is there a proper way to handle the attachment?

Parents
  • Former Member
    0 Former Member

    te_Attachments doesn't have its own index, do you mean that the blog post shows up as indexed?

    Have you ensured that Search Index has run since the move?

    Are there any exceptions in the exceptions log?

  • Let me clarify.  The blog post shows up in the old group in the search facet.   It is actually located in the correct group.  However, the duplicate file in te_attachment is still concerning because it is tied to both the old and new blog application with the same contentid.

    9109 454 1 0 34207 2482 2012-11-30 14:26:24.770 ESG Offsite Agenda 5 DEC 2012 Rev 4.docx application/vnd.openxmlformats-officedocument.word
    27210 836 1 0 34207 0 2021-02-11 19:08:45.670 ESG Offsite Agenda 5 DEC 2012 Rev 4.docx application/vnd.openxmlformats-officedocument.word

  • Former Member
    0 Former Member in reply to Navy OGC

    Can you share the code you are using/endpoints you are calling?

  •         If Await UpdateTags(dataRow, dataRow("Tags") & String.Format(",Archived From {0}: {1}", dataRow("Group"), dataRow("Application"))) Then
                    response = Await host.PostToDynamicAsync(2, "contentconversion/conversion.json", False, New RestPostOptions() With {
                            .AdditionalHeaders = GetHeaders(),
                            .PostParameters = New NameValueCollection() From {
                                {"SourceContentTypeId", dataRow("ContentTypeId")},
                                {"SourceContentId", dataRow("ContentGuid")},
                                {"TargetContentTypeId", dataRow("ContentTypeId")},
                                {"TargetApplicationId", applicationId},
                                {"TargetApplicationTypeId", dataRow("ApplicationTypeId")}
                            }
                        })

Reply
  •         If Await UpdateTags(dataRow, dataRow("Tags") & String.Format(",Archived From {0}: {1}", dataRow("Group"), dataRow("Application"))) Then
                    response = Await host.PostToDynamicAsync(2, "contentconversion/conversion.json", False, New RestPostOptions() With {
                            .AdditionalHeaders = GetHeaders(),
                            .PostParameters = New NameValueCollection() From {
                                {"SourceContentTypeId", dataRow("ContentTypeId")},
                                {"SourceContentId", dataRow("ContentGuid")},
                                {"TargetContentTypeId", dataRow("ContentTypeId")},
                                {"TargetApplicationId", applicationId},
                                {"TargetApplicationTypeId", dataRow("ApplicationTypeId")}
                            }
                        })

Children