[Announce] Search & replace / batch process Discourse posts
This looks similar to SMF2’s quote syntax. You could copy my somewhat over-engineered solution from the SMF2 importer…
@elberet: Unfortunately I don’t speak Ruby and am not familiar with the Discourse internals and DB schema, and the SMF importer is quite different from the MyBB one (I guess the magic is in the
Could you point me towards how, for starters, to patch the MyBB script to convert the date in the quote line?
Also, how practical would it be to just go ahead with the migration, and later patch the quote line in the imported posts?
Can you elaborate on what you are doing there? For us, it has never worked, it always gives a ‘recursion too deep’ error and then crashes.
I’ve looked some more into this. The quote syntax for MyBB is:
[quote='username' pid='1234' dateline='1412029545'] ... [/quote]
In Discourse, it’s
[quote="username, post:12, topic:1234"] ... [/quote]
You want to call
post_id_from_imported_post_id from the import script.
That seems to return only one id. Don’t we need the post number within the topic (not its id), and the topic id?
Well, you can pass that to
Post.find(id) and get the
topic_id out from that.