User blog comment:Cristina7/Introducing Discussions, a New Platform For Engaging Your Community/@comment-6100947-20160909050435/@comment-452-20160909142314

"The question is, can it be done and to what degree..."

Yes, it can be done, the degree depends on whether you care about the page history accurately attributing the revisions.

If I was just doing this for myself, I would normally export it, and run it through a short PHP script to reformat it, but I think in this case I'll do it in javascript, and share the script with everyone.

With javascript, I've already written a script which retrieves the internal page name from the thread ID, I'll be expanding that to also retrieve all thread replies, and to reformat the entire thread into single forum post with signed comments.

I'll personally be importing that data as correctly attributed revisions, but I'll also provide a copy/paste version for people who don't care about that sort of thing.
 * Whether correctly attributing revisions via page history is technically/legally required is unknown, as Wikia refuses to answer the question as it constitutes "legal advice". To be safe, I'd use "This forum thread was previously located at Thread:1234" at a minimum.

(I have no ETA on this, I'll do it sometime in the next month and post it on the forum here as a blog post)

edit: I'm going to have to get clever to maintain history of comment edits, but I think I can handle it.

edit: Sorry for the lack of updates on this, I got the bulk of script done a month ago, and I've been finishing and polishing it as I've had time.


 * Edit history is maintained perfectly
 * Unfortunately, due to the fact that the act of importing is regarded as a "edit" in the page history, the forum index shows the thread as being edited on the day you import them.
 * This can be fixed after importing by deleting each forum thread and restoring all revisions except the import revision itself. - "look into doing this via the API" is on my to-do list.
 * Subject is extracted from metadata and used as a page name
 * I was originally stripping the subject/highlight/topics metadata, but that resulted in revisions where nothing changed but the timestamp, so I've left the metadata tags in the source so there's no confusion - this is not visible on the published page.
 * While subject, highlight, and topic status are included in the metadata, the remove/delete/close status is not. It does not appear to be possible to use the normal API to get the remove/delete/closed status of a thread.  It's probably possible another way, but I will not be adding that functionality to my script.  Personally, I've simply manually pre-deleted all fake-deleted threads and comments.  As it stands, I recommend for all admins who want to port New Forum threads to Old Forum threads to review all pages after importing and delete anything which needs to be deleted.
 * Due to the fact that admins may have "edited" comments to add topics or something, the signature for each post contains both the original user/time, and last edited user/time
 * It does not appear to be possible to use the normal API to determine the name of the board: while the internal name does contain the name of the original board it was posted on, when a thread is moved the internal board name is not changed. So I'm personally just putting all my moved threads into a single forum, and sorting them manually.
 * Handling special characters was a minor roadblock, thankfully I created a script years ago to encode special characters.
 * As it's impossible to automatically tell whether a reply is a reply to the OP or the previous post, I've included the option for a single indent or incremental indents - people who care about properly indenting will need to edit each resulting Forum page manually.


 * I will also be creating a version of the script to port all blogs and comments to forum posts, because Wikia Staff have finally stated that they will not be restoring the ability for search engines to see blog comments as they were before lazy loading was introduced.
 * As Message Wall works in the exact same way, I will probably also be creating a version to port all Message Wall threads to talk pages, because Wikia Staff have apparently abandoned Message Wall improvements also.

My test data is 513 revisions in 158 posts across 40 threads. All have imported successfully. The great thing about errors in an import is that the page ends up blank, so you know pretty easily whether something messed up.
 * As my test wiki had less than the API limit, I hadn't coded it to handle over 1000 revisions, but I've now added that and I'm currently running a test on a forum with 4095 revisions in 2940 posts across 284 threads.  It's taking a lot longer, hopefully it will complete without crashing my browser.

It is entirely possible, and indeed likely, that there could be errors on other wikis which are not present in my test data, so rather than give out my script and possibly mess things up, I'll just help anyone who wants to switch over their forum.

I'll provide an xml file which an admin can then import, as well as a simple script to delete all Special:Forum pages before disabling it in WikiFeatures.