Is it possible to replace/change an embedded post's behavior?

AI-generated summary

FoohonPie wants to replace embedded posts from a Ghost blog with plain posts on Discourse, without the “Show Full Post” and “This is a companion discussion topic…” features. However, when editing the original post, the markdown is not rendering correctly. sam suggests there is metadata that needs to be removed and provides a potential solution involving running a script in the Discourse console, but warns that it may not be safe and could result in data loss. FoohonPie intends to test the solution on a copy to avoid potential issues.

Hello,

Last year I hooked up my Ghost blog to my Discourse forum and went about my blogging ways. However, I’ve since decided to kill the blog, but I want to preserve the content on Discourse directly.

I’m editing the original first post in the topic and replacing it with the original markdown from my blog. All is well in the preview, but the end result ends up as a jumble of un-rendered markdown with all newlines removed; a giant block of text. Additionally, the “Show Full Post” and “This is a companion discussion topic…” still persist.

Is it possible to do what I am attempting, or do I need to recreate each topic and juggle replies between the old and new versions, or perhaps something else entirely?

Simply put, I want to replace these with just plain posts, with Discourse not treating them any differently than if I had posted them directly on Discourse to begin with.

Thank you.

Yeah this is tricky, there is metadata that needs to be nuked. You could try taking a FULL BACKUP and then:

./launcher enter app
rails c
Post.where('id in (select post_id from topic_embeds)').update_all(cook_method: 1)
TopicEmbed.destroy_all

:warning: This may work, or it may obliterate data you don’t want obliterated. If you want the “safe” way, you are going to need to recreate topics and move posts.

Thanks @sam, I’ll test this on a copy to be safe!