Imported MyBB database MyCode issue

I am in the process of migrating a MyBB forum to Discourse
I see with imported posts a lot, but not all, contain visible MyCode formatting tags.

example (there are also apparent UTF-8 character encoding issues, which is subject of separate thread):

TTTThao Nguyen

Jul '18

[quote=“admin, post:4, topic:1297”]

Thanks Paul, I’m not sure this would work based on their response below-

[color=#222222][size=medium][size=small][font=Calibri, sans-serif]It is not an issue of whether the stairs are considered to be a building or not, my query does not have anything to discount that but rather the nature of the attachment between the two buildings to determine whether it is one building or two.[/font][/size][/size][/color]
[color=#222222][size=medium][size=small][font=Calibri, sans-serif] [/font][/size][/size][/color][color=#222222][size=small][font=Calibri, sans-serif]There is no internal connection or access between the two buildings so it’s not interpreted as one building/firecell.[/font][/size][/color]
[color=#222222][size=medium][size=small][font=Calibri, sans-serif]Â [/font][/size][/size][/color][color=#222222][size=small][font=Calibri, sans-serif]Therefore C/AS1 5.1.2 applies[/font][/size][/color]

So ‘internal access’ is the deciding factor…although I am quite sure I have seen plenty of garages etc that are attached to the house without internal access that do not required fire rating. (For the record we have a fire engineer on this job but they don’t seem to take notice of what he says either!!) Maybe I need to hire a good fire engineer as well!!!  :-/

Anyway, thanks for suggesting I post on this forum. Appreciate the advice and the support!!

How can these be parsed, so that intended formatting (which looks fine in MyBB) rather than the formatting tags appears in Discourse, as far as possible?

I am guessing that the problem is at least partly that Discourse does not support text with user selected font, size and colour?

[color=#222222][size=medium][size=small][font=Calibri, sans-serif]

or what I assume are hard returns

[hr]

I have no particular problem with Discourse not supporting multiple fonts etc myself, but it would be good if there was a way any unusable formatting tags were neatly filtered out on import.

I installed GitHub - discourse/discourse-bbcode: vBulletin BBCode plugin in the hopes this would help, but it looks like this plugin is no longer working under current version of Discourse

Similarly, when a MyCode tag references an attached image (that was inline with text in the MyBB original), how can this attachment be made to appear inline with text, rather than the tag appearing?

1 Like

You can have a look at the vBulletin importer which does a bunch of replacements of such tags. There is also a bbcode plugin that will support many of them.

With the quotes you need to be sure that there are new lines before the opening and after the closing tags.

5 Likes

I had the same issue when importing a very old (2002) PhpBB forum and I added various regexes to the importer to remove (or maybe replace in some case) these BBCode tags. It worked quite well in the end.

I also had the [quotes] issue when I had to “move” them on their own line in order to be correctly displayed with markdown.

I found this in some personal logs, I believe it’s what I achieved for this particular issue:

text.gsub!(/(\[\/?quote.*?\])/mi) { |q| "\n#{q}\n" }

From what I wrote at this time, it worked for all quotes on 150000 messages except… 57 quotes for unknown reasons and such a small number of failed quotes didn’t really matter. I could even fix them manually.

5 Likes

The vBulletin importer has several replacements for various quote versions. Even one that’ll get the post number for a proper reference.