Jump to content

JayX

Clients
  • Posts

    279
  • Joined

  • Last visited

Reputation Activity

  1. Like
    JayX got a reaction from VAXXi in Broken quotes, images, links, avatar? Here's My Fixes   
    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. 
  2. Like
    JayX got a reaction from sobrenome in Broken quotes, images, links, avatar? Here's My Fixes   
    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. 
  3. Like
    JayX got a reaction from Dolfan23b in Broken quotes, images, links, avatar? Here's My Fixes   
    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. 
  4. Like
    JayX got a reaction from ~sullengirl~ in Broken quotes, images, links, avatar? Here's My Fixes   
    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. 
×
×
  • Create New...