<?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>Mon, 30 Jan 2012 12:00:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cheap File Replication: Synchronizing Web Assets with fsniper</title>
		<link>http://www.alwaysgetbetter.com/blog/2010/11/14/cheap-file-replication-synchronizing-web-assets-fsniper/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2010/11/14/cheap-file-replication-synchronizing-web-assets-fsniper/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 17:31:44 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=341</guid>
		<description><![CDATA[Awhile ago I wrote about how I was using nginx to serve static files rather than letting the more memory-intensive Apache handle the load for files that don&#8217;t need its processing capabilities. The basic premise is that nginx is the web-facing daemon and handles static files directly from the file system, while shipping any other [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/03/04/defaulting-null-variables/' rel='bookmark' title='Defaulting Null Variables'>Defaulting Null Variables</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/' rel='bookmark' title='Memcached as Session Handler'>Memcached as Session Handler</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Awhile ago I wrote about how I was <a href="http://www.alwaysgetbetter.com/blog/2010/09/25/give-apache-break-nginx/">using nginx to serve static files</a> rather than letting the more memory-intensive Apache handle the load for files that don&#8217;t need its processing capabilities. The basic premise is that nginx is the web-facing daemon and handles static files directly from the file system, while shipping any other request off to Apache on another port.</p>
<p>What if Apache is on a different server entirely? Unless you have the luxury of an NAS device, your options are:</p>
<p><strong>1. Maintain a copy of the site&#8217;s assets separate from the web site</strong><br />
There are two problems with this approach: maintainability, and synchronization. You&#8217;ll have to remember to deploy any content changes separately to the rest of the site, which is counter-intuitive and opens up your process to human error. User-generated content stays on the Apache server and would be inaccessible to nginx.</p>
<p><strong>2. Use a replicating network file system like GlusterFS</strong><br />
Network-based replication systems are advanced and provide amazing redundancy. Any changes you make to one server can be replicated to the others very quickly, so any user generated content will be available to your content servers, and you only have to deploy your web site once.</p>
<p>The downside is that many NFS solutions are optimized for larger (>50Mb) filesizes. If you rely on your content server for small files (images, css, js), the read performance may decline when your traffic numbers increase. For high availability systems where it is critical for each server to have a full set of up-to-date files, this is probably the best solution.</p>
<p><strong>3. Use an rsync-based solution</strong><br />
This is the method I&#8217;ve chosen to look at here. It&#8217;s important that my content server is updated as fast as possible, and I would like to know that when I perform disaster recovery or make backups of my web site the files will be reasonably up to date. If a single file takes a few seconds to appear on any of my servers, it isn&#8217;t a huge deal (I&#8217;m just running WordPress).</p>
<p><strong>The Delivery Mechanism</strong><br />
rsync is fast and installed by default on most servers. Pair it with ssh and use password-less login keys, and you have an easy solution for script-able file replication. The only missing piece is the &#8220;trigger&#8221; &#8211; whenever the filesystem is updated, we need to run our update script in order to replicate to our content server.</p>
<p>Icrond is one possible solution &#8211; whenever a directory is updated icrond can run our update script. The problem here is that service does not act upon file updates recursively. <strong>fsniper</strong> is our solution.</p>
<p>The process flow should look like this.<br />
1. When the content directory is updated (via site upload or user file upload), fsniper initiates our update script.<br />
2. Update script connects to the content server via ssh, and issues an rsync command between our content directory and the server&#8217;s content directory.<br />
3. Hourly (or whatever), initiate an rsync command from the content server to any web servers &#8211; this will keep all the nodes fairly up-to-date for backup and disaster recovery purposes.</p>
<div style="width:468px;margin:0 auto">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-0410364841759590";
/* Homepage, 468x60 ads, After posts, created 12/19/08 */
google_ad_slot = "4210204644";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/03/04/defaulting-null-variables/' rel='bookmark' title='Defaulting Null Variables'>Defaulting Null Variables</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/' rel='bookmark' title='Memcached as Session Handler'>Memcached as Session Handler</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2010/11/14/cheap-file-replication-synchronizing-web-assets-fsniper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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/2011/04/20/database-migrations/' rel='bookmark' title='Database Migrations'>Database Migrations</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 = &#8216;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/2011/04/20/database-migrations/' rel='bookmark' title='Database Migrations'>Database Migrations</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>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: alwaysgetbetter.com @ 2012-02-05 04:06:53 -->
