tag:www.rhnh.net,2008:/s3 S3 - Xavier Shay's Blog 2009-03-09T15:25:00Z Enki Xavier Shay notreal@rhnh.net tag:www.rhnh.net,2008:Post/794 2009-03-09T15:25:00Z 2009-03-09T15:25:00Z Backup MySQL to S3 with Rails <p><strong><span class="caps">UPDATE</span>:</strong> This code is too old. Use <a href="https://github.com/yob/db2fog">db2fog</a> instead. It does the same thing but better.</p> <p>Here is some code I wrote over the weekend &#8211; <a href="http://github.com/xaviershay/db2s3">db2s3</a>. It&#8217;s a rails plugin that provides rake tasks for backing up your database and storing it on Amazon&#8217;s S3 cloud storage. S3 is a trivially cheap offsite backup solution &#8211; for small databases it costs about 4 cents per month, even if you&#8217;re sending full backups every hour.</p> <p>There are <a href="http://info-architects.net/2007/08/25/rake-task-for-mysql-backup-to-amazon-s3/">many</a> <a href="http://pauldowman.com/2009/02/08/mysql-s3-backup/">scripts</a> <a href="http://therailscoder.typepad.com/the_rails_coder_ruby_on_r/2008/04/automatic-mysql.html">around</a> that do this already, but they fail to address the biggest actual problem. The <a href="http://amazon.rubyforge.org">aws-s3</a> gem provides a really nice ruby interface to S3, and dumping a backup then storing it really isn&#8217;t that hard. The real problem is that <strong>I really hate system administration.</strong> I want to spend as little time as possible and I want things to Just Work.</p> <p>A script is great but there&#8217;s still too many things for me to do. Where does it go in my project? How do I set my credentials? How do I call it?</p> <p>That&#8217;s why a plugin was needed. It&#8217;s as little work as possible for a rails developer to backup their database, so they can get back to making their app awesome.</p> <p><a href="http://github.com/xaviershay/db2s3">db2s3</a>. Check it out.</p>