Removing vBulletin bbcodes after importing database

asterix23

Member
Hi

Just switch from vBulletin, I have now a lot of tags like this
[youtube=425,350]string[/youtube]
[YOUTUBE=string]string[/youtube]

How to replace this with
HTML:
[media=youtube]\1[/media]
?

I did a try with Post Content Find / Replace, but did not work for me.
 
I've got a different set of code to change, I don't understand how it works, anyone help>?

Code:
[video=youtube;vPW6k3GWeUs]http://www.youtube.com/watch?v=vPW6k3GWeUs[/video]
 
Anyone have any idea what I'm doing wrong? I'm getting a "Please enter a valid message." error when trying to replace Youtube videos as advised in the description. I'm assuming it's trying to insert a blank message somewhere, but I don't know why I'd be replacing the video with a blank message.

ClPJI.jpg


H9WES.jpg
 
Last edited:
Anyone have any idea what I'm doing wrong? I'm getting a "Please enter a valid message." error when trying to replace Youtube videos as advised in the description. I'm assuming it's trying to insert a blank message somewhere, but I don't know why I'd be replacing the video with a blank message.

ClPJI.jpg


H9WES.jpg

That error usually indicates an empty post, but that shouldn't happen with your replacement.

Try submitting that replacement without "Save Changes" to preview what the result is.
 
That error usually indicates an empty post, but that shouldn't happen with your replacement.

Try submitting that replacement without "Save Changes" to preview what the result is.

Yeah it works fine without save changes - gives me 19,000+ results - and I've painfully waded down them to see if there were any empty ones, and there's none that I can see. I tried staggering the calls with your script modification with no luck as well.
 
That error usually indicates an empty post, but that shouldn't happen with your replacement.

Try submitting that replacement without "Save Changes" to preview what the result is.

Sorry to be a torture Jake, but do you have to hand the 'direct to database' SQL queries/regular expressions to do the same thing? (I'll do a trial run on a test site - at least it will return specific errors) I'm sure I seen you post them somewhere here before but I can't find them now. I've got a newly converted 7 million post forum with 20k of unparsed Youtube videos, and since the natives didn't want 'change' in the first place I need to placate them with fixes :whistle:
 
MySQL has no regex replace to my knowledge. It requires a user defined function.

...7 million post...

That replacement tool doesn't handle large numbers of posts very well. This might help:

https://xenforo.com/community/threads/import-from-ipb-3-2-posts-not-parsed-at-all.39577/#post-435226

Otherwise I wrote a custom script to do replacements on extremely large forums. But using it safely and effectively requires working with the code. I can use this script on your forum but I would insist on running it myself. If you want me to do this then send me a PM with FTP access and links to posts that need fixing.
 
Top Bottom