<?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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Always Get Better &#187; Wordpress</title>
	<atom:link href="http://www.alwaysgetbetter.com/blog/category/blogging/wordpress-blogging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alwaysgetbetter.com/blog</link>
	<description>Never stop looking for ways to improve</description>
	<lastBuildDate>Wed, 02 Jun 2010 12:16:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Move a Wordpress Database</title>
		<link>http://www.alwaysgetbetter.com/blog/2009/04/04/move-wordpress-database/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2009/04/04/move-wordpress-database/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 15:48:29 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=205</guid>
		<description><![CDATA[One of the most common requirements for web developers is the ability to switch code from development servers to live production environments. This can be tricky if you&#8217;re working with Wordpress; moving the files is dead simple, but since Wordpress uses canonical URLs you have to be careful if you are trying to transfer any [...]


Related posts:<ol><li><a href='http://www.alwaysgetbetter.com/blog/2009/11/05/vista-fix-sql-server-express-error-create-database-permission-denied-database-master/' rel='bookmark' title='Permanent Link: VISTA: How to fix SQL Server Express Error &#8211; CREATE DATABASE permission denied in database &#8216;master&#8217;'>VISTA: How to fix SQL Server Express Error &#8211; CREATE DATABASE permission denied in database &#8216;master&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the most common requirements for web developers is the ability to switch code from development servers to live production environments. This can be tricky if you&#8217;re working with Wordpress; moving the files is dead simple, but since Wordpress uses canonical URLs you have to be careful if you are trying to transfer any of your database content.</p>
<p>Canonical URLs force your site to use the same base path (www.yourdomain.com rather than yourdomain.com). But if you are working in a development environment &#8211; e.g. the development site&#8217;s address isn&#8217;t the same as your web site, but is rather something like 127.0.0.1 &#8211; you need to be able to make the switch to Wordpress without bringing your site down.</p>
<p>Since I end up having to look for this information so often, here are the steps I use to accomplish this amazing feat:</p>
<h2>Download The Database</h2>
<p>From the shell prompt of your server, dump Wordpress&#8217; MySQL database into a backup file:</p>
<p><code>mysqldump –-add-drop-table -uusername -ppassword databasename &gt; mysqlbackup.DATE.sql</code></p>
<p>Move it over to the new server and run this command to overwrite your target:</p>
<p><code>mysql -udb##### -p -hinternal-db.s#####.gridserver.com db#####_dbname &lt; mysqlbackup.DATE.sql </code></p>
<h2>Update the Database Paths</h2>
<p>Log into your MySQL database and issue this update command to ensure Wordpress redirects to the new server:</p>
<p>UPDATE wp_options SET option_value = replace(option_value, &#8216;http://www.old-domain.com&#8217;, &#8216;http://www.new-domain.com&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8217;siteurl&#8217;;</p>
<p>Next update the post URLs:</p>
<p>UPDATE wp_posts SET guid = replace(guid, &#8216;http://www.old-domain.com&#8217;,'http://www.new-domain.com&#8217;);</p>
<p>Finally, update your posts&#8217; content to fix any internal links:</p>
<p>UPDATE wp_posts SET post_content = replace(post_content, &#8216;http://www.old-domain.com&#8217;, &#8216;http://www.new-domain.com&#8217;);</p>
<p>That&#8217;s all!  Repeat these steps when moving from production to development and vise-versa.</p>
<p>As I said I typically search for this information whenever I need to move Wordpress sites. I find the SQL queries at: <a href="http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/">http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/</a></p>


<p>Related posts:<ol><li><a href='http://www.alwaysgetbetter.com/blog/2009/11/05/vista-fix-sql-server-express-error-create-database-permission-denied-database-master/' rel='bookmark' title='Permanent Link: VISTA: How to fix SQL Server Express Error &#8211; CREATE DATABASE permission denied in database &#8216;master&#8217;'>VISTA: How to fix SQL Server Express Error &#8211; CREATE DATABASE permission denied in database &#8216;master&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2009/04/04/move-wordpress-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
