Thread:KockaAdmiralac/@comment-9605025-20191028042947/@comment-27345308-20191028112418

I don't really, it was just something I was considering in the past. I just wanted to see if Staff are actually giving us a choice or are just forcing a migration to Discussions with DPLforums mentioned as "an option" just so it looks like we can choose not to enable Discussions. The XML edits would need to be pre-import, post-export, as once you have imported the pages you can't just change their attribution. If you'd like to think about the implementation yourself, the algorithm I thought of would be something like:
 * 1) Use an XML parser for your respective programming language to parse the XML export of thread pages into a (DOM-like) tree
 * 2) Go through the tree and create a map of main thread page names to the lists of page names of their replies, and then sort these lists by the timestamp they were posted on (maybe you don't need to, if the XML export has the pages sorted by ID)
 * 3) Go through the map keys (main thread names) and for each do:
 * 4) Initialize an empty string for the new page's content
 * 5) Extract the thread's title from   tags in the page and then strip them
 * 6) For the main thread and each reply do:
 * 7) Append main thread/reply content
 * 8) Append the user's signature (either grab it from the API or fabricate it)
 * 9) Append a post separator (for example,  . The easier way won't work for moved threads, as after a thread has been moved its page name does not change.
 * 10) Fabricate a new node in your XML tree of pages with the title of   and content set to the string you appended all of the contents to
 * 11) Save the new tree into an XML file with as similar format as possible to the exported XML file
 * 12) Import that file.

Have you used AjaxThreadDelete to delete the replies? If so, yes, mode 3 of the deletedrevs API documentation sounds like something you might need. If not, you don't need to call the deletedrevs API at all. Either way, yes, you should be able to get all thread revisions with these two endpoints.

I might be wrong, but I think deleted revisions might not actually have a page ID, only the revision ID, which is why restoring thread pages after a (standard MediaWiki) deletion does not restore the whole thread properly.