<?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>Parallelcoding.com &#187; MySQL</title>
	<atom:link href="http://www.parallelcoding.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parallelcoding.com</link>
	<description>Intelligent, Efficient, Parallel, and Sustainable Code</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:17:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Syncing WordPress Databases</title>
		<link>http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/</link>
		<comments>http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 18:57:27 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=419</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/" title="Syncing WordPress Databases"></a>Whenever I'm doing any WordPress development, I eventually have the need to sync the data between the current dev server, possibly a staging server, and a live server. What's the easiest way to move a WordPress database between 2 servers? &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/" title="Syncing WordPress Databases"></a><p>Whenever I'm doing any WordPress development, I eventually have the need to sync the data between the current dev server, possibly a staging server, and a live server. What's the easiest way to move a WordPress database between 2 servers?</p>
<p><br/></p>
<p>Let's start this example by saying that we have 2 servers: Dev and Live. Each server has a mostly identical WordPress installation and each server has it's own database. In order to sync the initial database from Dev to Live the following steps may be used:</p>
<ol>
<li>Use PHPMyAdmin to export the Dev database as a file</li>
<li>Use PHPMyAdmin to export the Live database as a file (this is a backup, just in case)</li>
<li>Import the Dev Database into the Live Database using PHPMyAdmin</li>
<li>Run the following 5 SQL commands in order to update the domain name in your site:

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> wp_multirss <span style="color: #990099; font-weight: bold;">SET</span> URL<span style="color: #CC0099;">=</span><span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>URL<span style="color: #000033;">,</span><span style="color: #008000;">'Dev<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #000033;">,</span><span style="color: #008000;">'Live<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> wp_multirss <span style="color: #990099; font-weight: bold;">SET</span> Favicon<span style="color: #CC0099;">=</span><span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>Favicon<span style="color: #000033;">,</span><span style="color: #008000;">'Dev<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #000033;">,</span><span style="color: #008000;">'Live<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> wp_posts <span style="color: #990099; font-weight: bold;">SET</span> post_content<span style="color: #CC0099;">=</span><span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>post_content<span style="color: #000033;">,</span><span style="color: #008000;">'Dev<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #000033;">,</span><span style="color: #008000;">'Live<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> wp_posts <span style="color: #990099; font-weight: bold;">SET</span> guid<span style="color: #CC0099;">=</span><span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>guid<span style="color: #000033;">,</span><span style="color: #008000;">'Dev<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #000033;">,</span><span style="color: #008000;">'Live<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> wp_options <span style="color: #990099; font-weight: bold;">SET</span> option_value<span style="color: #CC0099;">=</span><span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>option_value<span style="color: #000033;">,</span><span style="color: #008000;">'Dev<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #000033;">,</span><span style="color: #008000;">'Live<span style="color: #008080; font-weight: bold;">_</span>Address'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

</li>
<li>And now, as long as you've written all your relative links correctly inside of your content, you're finished!</li>
</ol>
<p>Once you have the initial transfer completed, future transfer are much simpler. Then you only need to complete the above steps by exporting, dropping, and importing the tables that are relevant to the changes that have been made. What tables are those? Honestly, it depends on what you have changed since last time. The best way to figure this out is to go to the <a href="http://codex.wordpress.org/Database_Description">Database Description</a> over at WordPress.org to see what you need to move.</p>
<p><br/></p>
<p>Happy migrating!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2009/06/08/syncing-wordpress-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

