<?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>x + 3 &#187; mysql</title>
	<atom:link href="http://xplus3.net/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://xplus3.net</link>
	<description></description>
	<lastBuildDate>Fri, 19 Aug 2011 01:05:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Save Time with sed</title>
		<link>http://xplus3.net/2009/11/28/save-time-with-sed/</link>
		<comments>http://xplus3.net/2009/11/28/save-time-with-sed/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 03:34:51 +0000</pubDate>
		<dc:creator>Jonathan Brinley</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://xplus3.net/?p=243</guid>
		<description><![CDATA[When I develop WordPress sites, I find that I end up repeating many identical tasks for each site. The phrase &#8220;repeating identical tasks&#8221; should (and does) set off alarms: This should be automated! To that end, I&#8217;m trying to learn some more command line tools for doing tasks that I currently use a GUI for. One such task is migrating &#8230; <a href="http://xplus3.net/2009/11/28/save-time-with-sed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I develop WordPress sites, I find that I end up repeating many identical tasks for each site. The phrase &#8220;repeating identical tasks&#8221; should (and does) set off alarms: This should be automated! To that end, I&#8217;m trying to learn some more command line tools for doing tasks that I currently use a GUI for.</p>
<p>One such task is migrating my development database to the staging/production server. Basically a <code>mysqldump</code> from my local database that I can then import on another server. A key thing to watch out for with WordPress, though, is the base URL for your site. If you&#8217;re serving a site from <code>localhost</code> while you develop it, you&#8217;ll need to change every occurrence of <code>localhost</code> in your database to the base URL for the new server.</p>
<p><code>sed</code> is a command line tool for doing just that job. It runs a regular expression search on the input and outputs the replacement. Example:</p>
<pre>$ echo "localhost" | sed "s/localhost/www.example.com/g"
www.example.org</pre>
<p>Pipe your <code>mysqldump</code> through <code>sed</code> to have an SQL file ready for your new server.</p>
<pre>$ mysqldump -uusername -ppassword database_name | sed "s/localhost/www.example.com/g" > database.sql</pre>
<p>This way I avoid having to open the SQL file in a text editor, doing a global search and replace, and re-saving.</p>
]]></content:encoded>
			<wfw:commentRss>http://xplus3.net/2009/11/28/save-time-with-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

