Page 1 of 1

Old-style BBCode in database after migration, reparse won't fix, how to then?

Posted: Sat Jul 15, 2017 9:55 am
by Ambis
Upgrade path is SMF 2.0.14 -> phpbb 3.0.11 (clean install) -> phpbb 3.2 (clean upgrade)

From SMF, my posts and PM's contain the basic BBCode from SMF, like:

Code: Select all

[quote="authorname"]...[/quote]
or
[img]https://example.com/someimage.jpg[/img]
When I run ./phpbbcli.php reparser:reparse, I does add <t> etc tags into the bodies, but it will not fix the old-style BBCode.

With MariaDB 10.2's REGEXP_REPLACE I have updated the BBCode to match that of 3.2, but the reparser strips all of it.

Code: Select all

<QUOTE author="dude"><s>[quote="dude"]</s>...<e>[/quote]</e></QUOTE> // gets stripped down to [quote="dude"]...[/quote] by the reparser
What is the best approach to getting the plain-style BBCode to work automatically?

If I edit a broken post in the forum, it does fix the BBCode, but I need to do this automagically for all posts and PMs.

Re: Old-style BBCode in database after migration, reparse won't fix, how to then?

Posted: Sat Jul 15, 2017 10:35 am
by Ambis
Just found this:
https://github.com/AlexSheer/phpBB3.2-STK

With it, I'm able to reparse the old-style bbcode! Yay!

Re: Old-style BBCode in database after migration, reparse won't fix, how to then?

Posted: Sat Jul 15, 2017 8:36 pm
by JoshyPHP
Ambis wrote:
Sat Jul 15, 2017 9:55 am
With MariaDB 10.2's REGEXP_REPLACE I have updated the BBCode to match [...]
Don't do that, you risk corrupting your data.

What exactly does not work, you didn't say. Give us an example of original input, expected output, actual output.

Re: Old-style BBCode in database after migration, reparse won't fix, how to then?

Posted: Sat Jul 15, 2017 8:44 pm
by Ambis
Problem was that after conversion (from SMF) all BBCode was plain [quote]'s and [img]'s even in the actual rendered post.

I did not find any way to convert these to display properly, like the quote you just wrote. They got updated to proper working BBCode if I manually edited a post, but I needed an automatic solution for all content.

I actually ended up using the old STK for phpBB 3.0 (since that version is what my migration happens against, from SMF). Nicer than the 3.2 STK since the old one is/was officially supported.

The STK solved my problem.

After migration I reparse BBCode with STK and then I upgrade it to phpBB 3.2.

Re: Old-style BBCode in database after migration, reparse won't fix, how to then?

Posted: Sat Jul 15, 2017 8:55 pm
by JoshyPHP
Ok, I understand now, the BBCodes appeared in plain text after the conversion. I don't know how the convertors work so I wouldn't know where to start.

Glad you found a way to make it work though.