• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Removing vBulletin bbcodes after importing database

#1
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.
 
#6
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]
 
#9
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.



 
Last edited:

Jake Bunce

XenForo moderator
Staff member
#10
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.



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.
 
#11
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.
 
#12
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:
 

Jake Bunce

XenForo moderator
Staff member
#13
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.
 

Jake Bunce

XenForo moderator
Staff member
#17