<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" >

<channel>
	<title>David Coveney&#187; &#187; migration</title>
	<atom:link href="http://www.davesgonemental.com/tag/migration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davesgonemental.com</link>
	<description>Work, travel and irreverence</description>
	<pubDate>Sun, 04 Jan 2009 12:04:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Resolving Wordpress Migration Issue</title>
		<link>http://www.davesgonemental.com/resolving-wordpress-migration-issue/</link>
		<comments>http://www.davesgonemental.com/resolving-wordpress-migration-issue/#comments</comments>
		<pubDate>Thu, 13 Jul 2006 16:24:40 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<category><![CDATA[migration]]></category>

		<category><![CDATA[resolution]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.davesgonemental.com/?p=87</guid>
		<description><![CDATA[I&#8217;m posting this for the benefit of anyone who experiences a similar problem to mine when moving Wordpress from a directory into the web&#8217;s root directory.
What happened was that many links and pictures, some placed in there by plugins, others simply links that were typed in, had failed.
I realised that although I&#8217;d followed the migration [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting this for the benefit of anyone who experiences a similar problem to mine when moving Wordpress from a directory into the web&#8217;s root directory.</p>
<p>What happened was that many links and pictures, some placed in there by plugins, others simply links that were typed in, had failed.</p>
<p>I realised that although I&#8217;d followed the migration instructions, a lot of things were left poorly sorted.  A quick run through of all the tables showed where values were left incorrectly set.  To fix this I wrote the following SQL statements and applied them to my database:</p>
<p>update wp_posts set guid = replace(guid,&#8221;/wordpress&#8221;,&#8221;");</p>
<p>update wp_postmeta set meta_value = replace(meta_value,&#8221;/wordpress&#8221;,&#8221;");</p>
<p>update wp_options set option_value = replace(option_value,&#8221;/wordpress&#8221;,&#8221;");</p>
<p>update wp_posts set post_content = replace(post_content,&#8221;/wordpress&#8221;,&#8221;");</p>
<p>These worked a treat.</p>
<p>To use this yourself I&#8217;ve done a version below that you can edit - simply replace $$$olddir$$$ with your old directory name (in my case wordpress) and replace $$$newdir$$$ with your new directory name.  If your new directory is the root, remove the / at the beginning of each $$$newdir$$$ - see my example above.</p>
<p>A couple of warnings though - <strong>first take a backup of your database!</strong> Then think carefully - if you don&#8217;t know what you&#8217;re doing you may well be advised in seeking someone out who does.<br />
update wp_posts set guid = replace(guid,&#8221;/$$$olddir$$$&#8221;,&#8221;/$$$newdir$$$&#8221;);</p>
<p>update wp_postmeta set meta_value = replace(meta_value,&#8221;/$$$olddir$$$&#8221;,&#8221;$$$newdir$$$&#8221;);</p>
<p>update wp_options set option_value = replace(option_value,&#8221;/$$$olddir$$$&#8221;,&#8221;$$$newdir$$$&#8221;);</p>
<p>update wp_posts set post_content = replace(post_content,&#8221;/$$$olddir$$$&#8221;,&#8221;$$$newdir$$$&#8221;);</p>
<p>Good luck and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davesgonemental.com/resolving-wordpress-migration-issue/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
