I’m converting my MyBB board to phpBB. The ONLY issue I’m having is that MyBB has quote tags like this:
[quote="Username" pid="4993" dateline="1703638754"]But phpBB3 uses this:
[quote="Username"]All I’d like to do is find any posts that contain the first format and change it into the second format within the database, then run the conversion again, which will fix the issue.
I tried this, but it only works if the post itself opens with a quote. Also if there are successive quote tags it doesn’t work on them
UPDATE mybb_posts
SET message =
CONCAT(
'%[quote="',
SUBSTRING_INDEX(SUBSTRING_INDEX(message, 'quote="', -1), '"', 1),
'"]%',
SUBSTRING_INDEX(message, '"]', -1)
) WHERE `message` LIKE '%[quote="%" pid="%" dateline="%"]%'
2
Answers
This query will be helpful for you.
You could use
regexp_replace
like:The
[^"]*
snippet means any character other than"
occuring zero or more times.Example at DB Fiddle