XF 2.2 Removing old BB code from posts.

Let's say I want to remove the following legacy BBcode:
Code:
[video=youtube]

Then I run:

SQL:
UPDATE xf_post SET message = REPLACE(message, '[video=youtube][/video]', '[MEDIA=youtube][/MEDIA]');

Is this correct? Just checking here before I bottle it and have to restore a backup. For example, the Xenforo Youtube embed code is:
Code:
[MEDIA=youtube][/MEDIA]

So, I don't want to remove the
Code:
=youtube]
part that matches on accident.

Post content find/replace doesn't work due to large forum size.
 
Assuming the video ID is between the existing tags like this -- [video=youtube]MurHt7Sxhyk[/video], you need to run two separate queries.

SQL:
UPDATE xf_post SET message = REPLACE(message, '[video=youtube]', '[MEDIA=youtube]');

UPDATE xf_post SET message = REPLACE(message, '[/video]', '[/MEDIA]');

Take a backup of the xf_post table first, just in case.
 
Assuming the video ID is between the existing tags like this -- [video=youtube]MurHt7Sxhyk[/video], you need to run two separate queries.

SQL:
UPDATE xf_post SET message = REPLACE(message, '[video=youtube]', '[MEDIA=youtube]');

UPDATE xf_post SET message = REPLACE(message, '[/video]', '[/MEDIA]');

Take a backup of the xf_post table first, just in case.
Thanks!
 
Back
Top Bottom