JayX Posted March 8, 2015 Posted March 8, 2015 I upgraded from 3.4.x to 4.0 and noticed a lot of the old content of the forum didn't transition so great - lots of broken links, old bb code, unreadable quoting structures etc. So I've put together some find/replace MySQL queries to help with getting as much of my community back as possible. My site has been on IPB since 2.0.0 DPR1 according to my log, since 2004. I'm not going to lie - there were a lot of stranded files (hopefully mostly resolved with IPB 4 as I migrated to a fresh install base) and tons of extra crap in my SQL DB. This is not really the ideal way to migrate your site I'm sure, but my site isn't ideal anyway ​Don't try any of this without backups - just because it worked for me doesn't mean it'll work for you and one bad line could break your site completely. UPDATE `ibf_forums_posts` SET `post` = replace(post, "[quote name=", '<blockquote class="ipsQuote" data-ipsquote="" data-ipsquote-username=') UPDATE `ibf_forums_posts` SET `post` = replace(post, "']", "'>") UPDATE `ibf_forums_posts` SET `post` = replace(post, "[/quote]", '</blockquote>') These 3 SQL queries above are designed to convert broken Quotes from 3.4.x. I still have a ton of quotes in posts from versions before that that appear to be harder to fix, but possible (replace can't use wildcards which is what's screwing me). UPDATE `ibf_forums_posts` SET `post` = replace(post, "[code]", '<pre data-pbcklang="html" data-pbcktabsize="4" class="html ipsCode prettyprint">') UPDATE `ibf_forums_posts` SET `post` = replace(post, "[/code]", '</pre>') These two are designed to replace the old 'code' bbcode that I use to put pieces of code in. Like I'm using here. UPDATE `ibf_forums_posts` SET `post` = replace(post, "[i]", '<em>') UPDATE `ibf_forums_posts` SET `post` = replace(post, "[/i]", '</em>') This is another BB code fix - this time for italics. Bold works similarly, as well as underline, strikethrough etc. Just convert from bbcode on the left to html style on the right, and don't forget to do the second replace to fix the close tags. UPDATE `ibf_forums_posts` SET `post` = replace(post, 'public/style_emoticons/<#EMO_DIR#>/unsure.gif', 'uploads/default_unsure.png.?????????.png') With broken avatars, I fix them by looking at what the filenames in /uploads/ are for the default and switch out the broken URLs to the new one. IP4 adds random characters to the filenames now (presumably to stop abc.jpg overwriting a preexisting abc.jpg) so you'll have to do them one at a time whenever you find broken links. UPDATE `ibf_forums_posts` SET `post` = replace(post, "[IMG]", '<img src="') UPDATE `ibf_forums_posts` SET `post` = replace(post, "[/IMG]", '" class="ipsImage">') Designed to fix images - however on my original attempt I got a piece of code wrong and broke a few hundred posts so this fixed version will hopefully work. Backup, I forgot to and had progressed too far since the last one so just put it down to experience. UPDATE `ibf_forums_posts` SET `post` = replace(post, "[URL=", '<a href=') UPDATE `ibf_forums_posts` SET `post` = replace(post, "[/URL]", '</a>') Likewise, this should fix links that have the old URL tags on them. Feel free to contribute any extras or better versions of the ones I've had some success with. I still have issues with my archive posts, but they're a lot more readable now and I'm happy enough with that. Dolfan23b, ~sullengirl~, VAXXi and 1 other 4
TracyIsland Posted March 8, 2015 Posted March 8, 2015 When I read a post like this, I get really really worried about the eventual upgrade of my site. Is your site really unusual? Otherwise, will everyone experience this kind of massive chaos and destruction? @Matt @Charles @Mark @Andy Millne @Rikki
JayX Posted March 8, 2015 Author Posted March 8, 2015 I think a lot of it is down to how many versions my site has been in over the years, as well as things like external scripts that haven't played nice. I'm by no means a particularly great administrator, and 10 years ago I was definitely worse! IP4.0 looks great to me, I so wish I was starting here with a clean database, but I know if I did that my site would die overnight. It's taken maybe a day to get my site that works fine 90% of the time for 90% of the users, and most errors beyond that will be a dead end link to an emoticon that's been moved and forgotten about.Â
Mark Posted March 8, 2015 Posted March 8, 2015 Everything should transition fine (though note that posts convert in the background after upgrading). I would not recommend running those queries, some are far too broad in scope and many will interfere with the correct converting of post data.If, after upgrading, and posts have finished converting, you are experiencing issues, please submit a support request so we can figure out what's happening and include a fix in the software itself if necessary. sobrenome 1
arnabc Posted January 27, 2021 Posted January 27, 2021 (edited) hello, as someone who has only just (like yesterday) upgraded from 3.4.3 to the current version i'm curious to know if mark's post above means that the broken quote, url and formatting tags in older posts will slowly convert over a period of days (weeks?) or if they should have finished converting soon after the upgrade was finished. i've noticed that quote etc. tags are fine in posts that were made closer to the upgrade time but are uniformly broken in much older posts. thanks! arnab Edited January 27, 2021 by arnabc
Stuart Silvester Posted January 27, 2021 Posted January 27, 2021 2 minutes ago, arnabc said: hello, as someone who has only just (like yesterday) upgraded from 3.4.3 to the current version i'm curious to know if mark's post above means that the broken quote, url and formatting tags in older posts will slowly convert over a period of days (weeks?) or if they should have finished converting soon after the upgrade was finished. i've noticed that quote etc. tags are fine in posts that were made closer to the upgrade time but are uniformly broken in much older posts. thanks! arnab There are a series of background tasks that run after the upgrade to re-format and upgrade content. You can view the progress of these on your AdminCP dashboard.
CoffeeCake Posted January 27, 2021 Posted January 27, 2021 17 minutes ago, arnabc said: but are uniformly broken in much older posts. These background processes run in reverse chronological order, so newest things are converted first. If after all the background processes are done, you might need to consider the above things. Jordan Miller 1
Jordan Miller Posted January 29, 2021 Posted January 29, 2021 On 1/27/2021 at 10:46 AM, arnabc said: hello, as someone who has only just (like yesterday) upgraded from 3.4.3 to the current version i'm curious to know if mark's post above means that the broken quote, url and formatting tags in older posts will slowly convert over a period of days (weeks?) or if they should have finished converting soon after the upgrade was finished. i've noticed that quote etc. tags are fine in posts that were made closer to the upgrade time but are uniformly broken in much older posts. thanks! arnab 🤯 What's your experience been like jumping from 3.4.3 to the latest?Â
Recommended Posts