<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Bulletproof backups for MySQL</title>
	<atom:link href="http://thinkvitamin.com/dev/bulletproof-backups-for-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/</link>
	<description>The Web Practitioner&#039;s Blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:33:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Dan admin</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-41265</link>
		<dc:creator>Dan admin</dc:creator>
		<pubDate>Wed, 23 Feb 2011 09:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-41265</guid>
		<description>Thanks for sharing, if you want to save your time you can use backup software like Handy Backup, it’s easy to use and reliable MySQL backup software. Hot SQL database backup software for Windows.
(http://www.handybackup.net/mysql-backup.shtml)</description>
		<content:encoded><![CDATA[<p>Thanks for sharing, if you want to save your time you can use backup software like Handy Backup, it’s easy to use and reliable MySQL backup software. Hot SQL database backup software for Windows.<br />
(<a href="http://www.handybackup.net/mysql-backup.shtml" rel="nofollow">http://www.handybackup.net/mysql-backup.shtml</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Local Internet Marketing</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-37834</link>
		<dc:creator>Local Internet Marketing</dc:creator>
		<pubDate>Sat, 20 Nov 2010 21:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-37834</guid>
		<description>Thanks iV thats helpfull.</description>
		<content:encoded><![CDATA[<p>Thanks iV thats helpfull.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lv</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-22313</link>
		<dc:creator>lv</dc:creator>
		<pubDate>Mon, 16 Aug 2010 00:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-22313</guid>
		<description>To avoid issues, I do a simple file test in my rsync cron script which gets deleted at the finish of the script. If the script gets run a second time it checks for the file, and aborts if found. This prevents multiple instances being run each day, which can cause issues for the initial long running backup.</description>
		<content:encoded><![CDATA[<p>To avoid issues, I do a simple file test in my rsync cron script which gets deleted at the finish of the script. If the script gets run a second time it checks for the file, and aborts if found. This prevents multiple instances being run each day, which can cause issues for the initial long running backup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-19952</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sat, 10 Apr 2010 04:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-19952</guid>
		<description>Great information. My concerns are managing my backups in bulk (if possible) With 100 + accounts on one server, it get very time consuming.</description>
		<content:encoded><![CDATA[<p>Great information. My concerns are managing my backups in bulk (if possible) With 100 + accounts on one server, it get very time consuming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-19310</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Sat, 20 Mar 2010 13:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-19310</guid>
		<description>I do our backups in a similar manner (and I *do* get to test using backups when clients go whoops!)

How do I do it?


Step 1:

First is to backup the database(s) to the filesystem in a common folder.

MySQL daily backups to a folder under /home/dbbackup for all DB&#039;s using an easy to install backup shell script (automysqlbackup)

http://sourceforge.net/projects/automysqlbackup/

apt-get install automysqlbackup on debian based systems.

automysqlbackup gets run daily, and it automatically handles daily, weekly, monthly folders + rotation (no need to reinvent the wheel).


Step 2:

rsync my entire home folder system (which is where I store all my user specific data) to another server.

This also runs daily (usually in our early 2am - 4am period).


Step 3: Optional

I also do a weekly backup of the complete backup folder to a different server so I have some &quot;history&quot;.

To make it even safer, I also do a monthly offsite of the backups.


Our specific setup is that 
I usually have a central backup server that I send data to (stuck on a spare drive on a less used web server).

Secondary and Tertiary backup backups are run from that.

Caveats - if your database is in iffy condition  - eg latin1 encoding, with UTF-8 data, or similar, or crashed tables, the backup will not be 100%.  automysqlbackup can be configured to email you on issues.  encoding related ones will not be seen until a restore is attempted, but other issues will be.  
I have successfully restored even with &quot;corrupt&quot; encoding data, whether it was latin1 -&gt; utf8 or utf8 double encoding.  Does need some handholding though if that needs to happen.

Having different snapshots of your data from different time periods (eg, daily, weekly, monthly) is important (and thats why I do it!).   
The number of times clients have come back with &quot;oh I deleted something 2 weeks ago&quot;, and I&#039;ve been able to restore it has meant that they&#039;re happy.

That said, it does mean you need to use a whack of drives for backup purposes.

In our case we only have 6 servers, and web + mysql takes roughly 600GB (still fairly easy to stick onto a single drive though).  They are scattered around different / regions also, so it can take a few days to complete an initial backup if I deploy a new backup server.  
To avoid issues, I do a simple file test in my rsync cron script which gets deleted at the finish of the script.  If the script gets run a second time it checks for the file, and aborts if found.  This prevents multiple instances being run each day, which can cause issues for the initial long running backup.</description>
		<content:encoded><![CDATA[<p>I do our backups in a similar manner (and I *do* get to test using backups when clients go whoops!)</p>
<p>How do I do it?</p>
<p>Step 1:</p>
<p>First is to backup the database(s) to the filesystem in a common folder.</p>
<p>MySQL daily backups to a folder under /home/dbbackup for all DB&#8217;s using an easy to install backup shell script (automysqlbackup)</p>
<p><a href="http://sourceforge.net/projects/automysqlbackup/" rel="nofollow">http://sourceforge.net/projects/automysqlbackup/</a></p>
<p>apt-get install automysqlbackup on debian based systems.</p>
<p>automysqlbackup gets run daily, and it automatically handles daily, weekly, monthly folders + rotation (no need to reinvent the wheel).</p>
<p>Step 2:</p>
<p>rsync my entire home folder system (which is where I store all my user specific data) to another server.</p>
<p>This also runs daily (usually in our early 2am &#8211; 4am period).</p>
<p>Step 3: Optional</p>
<p>I also do a weekly backup of the complete backup folder to a different server so I have some &#8220;history&#8221;.</p>
<p>To make it even safer, I also do a monthly offsite of the backups.</p>
<p>Our specific setup is that<br />
I usually have a central backup server that I send data to (stuck on a spare drive on a less used web server).</p>
<p>Secondary and Tertiary backup backups are run from that.</p>
<p>Caveats &#8211; if your database is in iffy condition  &#8211; eg latin1 encoding, with UTF-8 data, or similar, or crashed tables, the backup will not be 100%.  automysqlbackup can be configured to email you on issues.  encoding related ones will not be seen until a restore is attempted, but other issues will be.<br />
I have successfully restored even with &#8220;corrupt&#8221; encoding data, whether it was latin1 -&gt; utf8 or utf8 double encoding.  Does need some handholding though if that needs to happen.</p>
<p>Having different snapshots of your data from different time periods (eg, daily, weekly, monthly) is important (and thats why I do it!).<br />
The number of times clients have come back with &#8220;oh I deleted something 2 weeks ago&#8221;, and I&#8217;ve been able to restore it has meant that they&#8217;re happy.</p>
<p>That said, it does mean you need to use a whack of drives for backup purposes.</p>
<p>In our case we only have 6 servers, and web + mysql takes roughly 600GB (still fairly easy to stick onto a single drive though).  They are scattered around different / regions also, so it can take a few days to complete an initial backup if I deploy a new backup server.<br />
To avoid issues, I do a simple file test in my rsync cron script which gets deleted at the finish of the script.  If the script gets run a second time it checks for the file, and aborts if found.  This prevents multiple instances being run each day, which can cause issues for the initial long running backup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18900</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Mon, 01 Mar 2010 17:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18900</guid>
		<description>Excellent article. I have been using MySQL for quite sometime and have learned the importance of having regular good backups the hard way!</description>
		<content:encoded><![CDATA[<p>Excellent article. I have been using MySQL for quite sometime and have learned the importance of having regular good backups the hard way!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris lea</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18399</link>
		<dc:creator>chris lea</dc:creator>
		<pubDate>Tue, 09 Feb 2010 08:29:23 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18399</guid>
		<description>Yup, I actually have stat in the script I use. I put this in here so people could see the awk snippet that people use all the time since it&#039;s really useful. As for using passwordless keys, that assumes you can key the remote machine, which isn&#039;t always the case. With the IBackup service I was detailing here, that&#039;s not an option for example. Though it does work perfectly well of course.

Thanks for pointing this out!</description>
		<content:encoded><![CDATA[<p>Yup, I actually have stat in the script I use. I put this in here so people could see the awk snippet that people use all the time since it&#8217;s really useful. As for using passwordless keys, that assumes you can key the remote machine, which isn&#8217;t always the case. With the IBackup service I was detailing here, that&#8217;s not an option for example. Though it does work perfectly well of course.</p>
<p>Thanks for pointing this out!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris lea</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18397</link>
		<dc:creator>chris lea</dc:creator>
		<pubDate>Tue, 09 Feb 2010 08:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18397</guid>
		<description>Hi Greg:

So the short answer is that just using a VPS somewhere else works just fine. iBackup has a few extra advantages.

1) All they do is backups. They probably don&#039;t have the sorts of issues that normal ISPs have to deal with (DDOS attacks, bad neighbor effects, etc). So their uptime is just great.

2) They are really super good about backing up whatever you have with them with their own backup systems. So your data is even *more* backed up. And more is better when it comes to backups IMO.

But honestly, sending backups off to another server in another data center is just fine too if it&#039;s cost sensitive.</description>
		<content:encoded><![CDATA[<p>Hi Greg:</p>
<p>So the short answer is that just using a VPS somewhere else works just fine. iBackup has a few extra advantages.</p>
<p>1) All they do is backups. They probably don&#8217;t have the sorts of issues that normal ISPs have to deal with (DDOS attacks, bad neighbor effects, etc). So their uptime is just great.</p>
<p>2) They are really super good about backing up whatever you have with them with their own backup systems. So your data is even *more* backed up. And more is better when it comes to backups IMO.</p>
<p>But honestly, sending backups off to another server in another data center is just fine too if it&#8217;s cost sensitive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris lea</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18396</link>
		<dc:creator>chris lea</dc:creator>
		<pubDate>Tue, 09 Feb 2010 08:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18396</guid>
		<description>Yup, snapshotting is an excellent option. I didn&#039;t go into it here for two reasons:

1) A lot of people these days are using VPS servers where you don&#039;t have the ability to do snapshots. You can on some, you can&#039;t on others.

2) Even if you&#039;re just running bare metal boxes, you may not have a filesystem that supports snapshotting. Most people just run with defaults and that usually means ext3 these days (no snapshots).

But yes, it&#039;s a great and easy option if it&#039;s available. I was just shooting for something that would always work. Thanks for pointing it out!</description>
		<content:encoded><![CDATA[<p>Yup, snapshotting is an excellent option. I didn&#8217;t go into it here for two reasons:</p>
<p>1) A lot of people these days are using VPS servers where you don&#8217;t have the ability to do snapshots. You can on some, you can&#8217;t on others.</p>
<p>2) Even if you&#8217;re just running bare metal boxes, you may not have a filesystem that supports snapshotting. Most people just run with defaults and that usually means ext3 these days (no snapshots).</p>
<p>But yes, it&#8217;s a great and easy option if it&#8217;s available. I was just shooting for something that would always work. Thanks for pointing it out!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: snetts</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18395</link>
		<dc:creator>snetts</dc:creator>
		<pubDate>Tue, 09 Feb 2010 08:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18395</guid>
		<description>Nice article on data backup. Making backups is a very important aspect in every IT pros career. Good work.</description>
		<content:encoded><![CDATA[<p>Nice article on data backup. Making backups is a very important aspect in every IT pros career. Good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dharmesh Shah</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18368</link>
		<dc:creator>Dharmesh Shah</dc:creator>
		<pubDate>Sun, 07 Feb 2010 03:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18368</guid>
		<description>We&#039;ve used this XFS snapshot model with great success (we have really big database for which MySQLDump is just not practical).

Works well within Amazon EC2 as well.</description>
		<content:encoded><![CDATA[<p>We&#8217;ve used this XFS snapshot model with great success (we have really big database for which MySQLDump is just not practical).</p>
<p>Works well within Amazon EC2 as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristian</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18367</link>
		<dc:creator>Kristian</dc:creator>
		<pubDate>Sun, 07 Feb 2010 03:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18367</guid>
		<description>Thinking too slowly :D

I think, now I know why you wrote:
STUNNEL_PORT=`/bin/grep ‘accept’ /etc/stunnel/ibackup.conf &#124; awk ‘{print $3}’`;

With $() command substitution you can use variables, so it make it more usable than backticks, for example:

#!/bin/sh
LSBIN=&#039;/bin/ls&#039;;
LSOUT=$($LSBIN -l);
echo $LSOUT;

So you can have variables for all the binaries.</description>
		<content:encoded><![CDATA[<p>Thinking too slowly :D</p>
<p>I think, now I know why you wrote:<br />
STUNNEL_PORT=`/bin/grep ‘accept’ /etc/stunnel/ibackup.conf | awk ‘{print $3}’`;</p>
<p>With $() command substitution you can use variables, so it make it more usable than backticks, for example:</p>
<p>#!/bin/sh<br />
LSBIN=&#8217;/bin/ls&#8217;;<br />
LSOUT=$($LSBIN -l);<br />
echo $LSOUT;</p>
<p>So you can have variables for all the binaries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristian</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18366</link>
		<dc:creator>Kristian</dc:creator>
		<pubDate>Sun, 07 Feb 2010 02:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18366</guid>
		<description>First of all, thanks for the article it was very infromative! I really have to read more about the replication.

And thanks for sharing the script, it&#039;s a good starting point, but it isn&#039;t too portable. For example:
STUNNEL_PORT=`/bin/grep &#039;accept&#039; /etc/stunnel/ibackup.conf &#124; awk &#039;{print $3}&#039;`;

What if the grep isn&#039;t there :) Not really a problem, because you will find that out soon enough :D

And if you want to risk some security, you could use which to find out binary paths.

Juano already wrote about using stat command...

And if I remember correctly, it&#039;s better to use $(ls foo) syntax than `ls foo`.

@Rob Morris
Configuration files and version information are sometimes crucial, a very good point!</description>
		<content:encoded><![CDATA[<p>First of all, thanks for the article it was very infromative! I really have to read more about the replication.</p>
<p>And thanks for sharing the script, it&#8217;s a good starting point, but it isn&#8217;t too portable. For example:<br />
STUNNEL_PORT=`/bin/grep &#8216;accept&#8217; /etc/stunnel/ibackup.conf | awk &#8216;{print $3}&#8217;`;</p>
<p>What if the grep isn&#8217;t there :) Not really a problem, because you will find that out soon enough :D</p>
<p>And if you want to risk some security, you could use which to find out binary paths.</p>
<p>Juano already wrote about using stat command&#8230;</p>
<p>And if I remember correctly, it&#8217;s better to use $(ls foo) syntax than `ls foo`.</p>
<p>@Rob Morris<br />
Configuration files and version information are sometimes crucial, a very good point!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Morris</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18363</link>
		<dc:creator>Rob Morris</dc:creator>
		<pubDate>Sat, 06 Feb 2010 21:34:40 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18363</guid>
		<description>VERY IMPORTANT NOTE: This is a great discussion of MySQL DB backups, but the initial list of items to back up is missing two crucial items.  Yes, you need your DB, static files and code, but don&#039;t forget:

- Configuration files - php.ini, httpd.conf, etc etc etc - these may have tons of tweaks added over several years.  Recreating them right on a system rebuild can be hell.
- Version information - Often, the versions of libraries, server software, etc. are critical, and again, if you keep the config files, you need a version of the software that can use that config file.

Just a couple of notes from someone who has had to do full system rebuilds on more than one occasion.  Great article, and good luck with those backups!</description>
		<content:encoded><![CDATA[<p>VERY IMPORTANT NOTE: This is a great discussion of MySQL DB backups, but the initial list of items to back up is missing two crucial items.  Yes, you need your DB, static files and code, but don&#8217;t forget:</p>
<p>- Configuration files &#8211; php.ini, httpd.conf, etc etc etc &#8211; these may have tons of tweaks added over several years.  Recreating them right on a system rebuild can be hell.<br />
- Version information &#8211; Often, the versions of libraries, server software, etc. are critical, and again, if you keep the config files, you need a version of the software that can use that config file.</p>
<p>Just a couple of notes from someone who has had to do full system rebuilds on more than one occasion.  Great article, and good luck with those backups!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juanjo</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18355</link>
		<dc:creator>Juanjo</dc:creator>
		<pubDate>Sat, 06 Feb 2010 11:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18355</guid>
		<description>PERMS=`/bin/ls -l $DOTIBACKUP &#124; /usr/bin/awk &#039;{print $1}&#039;`

stat is your friend!

ie. stat -c %a $DOTIBACKUP will report the access permissions in octal.

Another suggestion would be using rsync over SSH with password-less auth using RSA keys.</description>
		<content:encoded><![CDATA[<p>PERMS=`/bin/ls -l $DOTIBACKUP | /usr/bin/awk &#8216;{print $1}&#8217;`</p>
<p>stat is your friend!</p>
<p>ie. stat -c %a $DOTIBACKUP will report the access permissions in octal.</p>
<p>Another suggestion would be using rsync over SSH with password-less auth using RSA keys.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tamashee</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18346</link>
		<dc:creator>Tamashee</dc:creator>
		<pubDate>Fri, 05 Feb 2010 22:44:50 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18346</guid>
		<description>Excellent article. I have been using MySQL for quite sometime and know the importance of having regular good backup :).
Thanks,</description>
		<content:encoded><![CDATA[<p>Excellent article. I have been using MySQL for quite sometime and know the importance of having regular good backup :).<br />
Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: y3ti</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18340</link>
		<dc:creator>y3ti</dc:creator>
		<pubDate>Fri, 05 Feb 2010 15:35:40 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18340</guid>
		<description>Very nice script for backup mysql database. Last year I wrote own script:
http://blog.y3ti.pl/2008/12/backup-mysql-na-szybko/

Post is wrote in polish language, but You will understand script in bash :) My script dump all databases in diffrent files, so We can simply restore only one database (not all databases).</description>
		<content:encoded><![CDATA[<p>Very nice script for backup mysql database. Last year I wrote own script:<br />
<a href="http://blog.y3ti.pl/2008/12/backup-mysql-na-szybko/" rel="nofollow">http://blog.y3ti.pl/2008/12/backup-mysql-na-szybko/</a></p>
<p>Post is wrote in polish language, but You will understand script in bash :) My script dump all databases in diffrent files, so We can simply restore only one database (not all databases).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18338</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Fri, 05 Feb 2010 14:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18338</guid>
		<description>Thanks for this. One thing. Since ibackup.com is more per GB than a standard VPS, why do you use it? I would just buy a basic Linux VPS from some hosting company and send my back-ups there. And I&#039;d have a spare server to do things with, if I needed. Does ibackup have some great feature I&#039;m missing over a VPS?</description>
		<content:encoded><![CDATA[<p>Thanks for this. One thing. Since ibackup.com is more per GB than a standard VPS, why do you use it? I would just buy a basic Linux VPS from some hosting company and send my back-ups there. And I&#8217;d have a spare server to do things with, if I needed. Does ibackup have some great feature I&#8217;m missing over a VPS?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Sowards</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18336</link>
		<dc:creator>Andy Sowards</dc:creator>
		<pubDate>Fri, 05 Feb 2010 13:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18336</guid>
		<description>Nice article Chris!

Great to get the info behind your script, and why its best to just go straight into the shell and back it up :)

Keep up the good work!</description>
		<content:encoded><![CDATA[<p>Nice article Chris!</p>
<p>Great to get the info behind your script, and why its best to just go straight into the shell and back it up :)</p>
<p>Keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SaltwaterC</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18335</link>
		<dc:creator>SaltwaterC</dc:creator>
		<pubDate>Fri, 05 Feb 2010 12:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18335</guid>
		<description>The solution from above is good, but not the best such as a dedicated commercial backup solution. What can I say, I am using this kind of solution for almost a couple of years. R1Soft&#039;s CDP Server + MySQL add-on does the job very well, but takes a different approach. It has less server load since it uses disk snapshots, and less traffic since it uses incremental backups. The admin panel makes the backup/restore to be an idiot proof operation. The CDP Agent may have some quirks, but overall the Server + Agents combination it is a great solution, not only for MySQL.

// Just a CDP Server satisfied customer</description>
		<content:encoded><![CDATA[<p>The solution from above is good, but not the best such as a dedicated commercial backup solution. What can I say, I am using this kind of solution for almost a couple of years. R1Soft&#8217;s CDP Server + MySQL add-on does the job very well, but takes a different approach. It has less server load since it uses disk snapshots, and less traffic since it uses incremental backups. The admin panel makes the backup/restore to be an idiot proof operation. The CDP Agent may have some quirks, but overall the Server + Agents combination it is a great solution, not only for MySQL.</p>
<p>// Just a CDP Server satisfied customer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandstream</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18334</link>
		<dc:creator>Sandstream</dc:creator>
		<pubDate>Fri, 05 Feb 2010 09:28:13 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18334</guid>
		<description>Nice article!

Any ideas of how to do it on a Windows machine?</description>
		<content:encoded><![CDATA[<p>Nice article!</p>
<p>Any ideas of how to do it on a Windows machine?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thibaut Allender</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18331</link>
		<dc:creator>Thibaut Allender</dc:creator>
		<pubDate>Thu, 04 Feb 2010 23:17:09 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18331</guid>
		<description>Nice tutorial. And if you are lazy like me and looking for an all-in-one backup solution providing several storage methods, you should definitely have a look at Backup-manager (http://www.backup-manager.org/).</description>
		<content:encoded><![CDATA[<p>Nice tutorial. And if you are lazy like me and looking for an all-in-one backup solution providing several storage methods, you should definitely have a look at Backup-manager (<a href="http://www.backup-manager.org/" rel="nofollow">http://www.backup-manager.org/</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Higginbotham</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18329</link>
		<dc:creator>James Higginbotham</dc:creator>
		<pubDate>Thu, 04 Feb 2010 22:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18329</guid>
		<description>Thanks for a great post - you have opened my eyes to some new techniques for making MySQL backups easier!

@John, great tip on bzip - I&#039;ve used it in the past for MySQL backup files and the compression is amazing compared to gzip.</description>
		<content:encoded><![CDATA[<p>Thanks for a great post &#8211; you have opened my eyes to some new techniques for making MySQL backups easier!</p>
<p>@John, great tip on bzip &#8211; I&#8217;ve used it in the past for MySQL backup files and the compression is amazing compared to gzip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lou Kosak</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18328</link>
		<dc:creator>Lou Kosak</dc:creator>
		<pubDate>Thu, 04 Feb 2010 21:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18328</guid>
		<description>Hi Chris,

Nice writeup. I find that I can never find a simple, effective backup script for MySQL when I&#039;m starting a new project on a host without any kind of backup facilities, so it&#039;s nice to have a point of reference!

I just wanted to note that in terms of worrying about locks, one way to avoid having to setup a slave for a busy DB is to store the DB data files on an XFS partition (http://en.wikipedia.org/wiki/Xfs). I used this once with a relatively small project when I didn&#039;t want to deal with the headaches of MySQL replication, and it worked pretty well.

The trick is to take advantage of XFS&#039;s support for snapshots. Basically, a snapshot of a drive can be taken at an exact INSTANT and survive for long enough for a dump to be taken from it. So instead of:

-locking all tables/databases
-dumping all data (which, as you said, can easily take 15+ seconds)
-unlocking all tables/databases

You can just:

-lock all tables/databases
-take an XFS snapshot (which usually takes &lt; 2 seconds)
-unlock all tables/databases (freeing up the DB to handle requests)

Then, at your leisure,
-launch a secondary MySQL server using the snapshot&#039;s DB data files
-perform a dump from this secondary server
-stop the secondary server and delete the snapshot

This frees up the DB server almost immediately, ensures atomized data, and avoids the effort of configuring and maintaining a replication setup (which, given MySQL replication&#039;s tendency to short-circuit, can definitely be a plus).

Setting up XFS isn&#039;t usually too difficult, although it&#039;s much easier to do when you already have a free partition. Most newer Linux kernels have no problem supporting it, and as far as I know, it performs pretty admirably.

-Lou</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Nice writeup. I find that I can never find a simple, effective backup script for MySQL when I&#8217;m starting a new project on a host without any kind of backup facilities, so it&#8217;s nice to have a point of reference!</p>
<p>I just wanted to note that in terms of worrying about locks, one way to avoid having to setup a slave for a busy DB is to store the DB data files on an XFS partition (<a href="http://en.wikipedia.org/wiki/Xfs" rel="nofollow">http://en.wikipedia.org/wiki/Xfs</a>). I used this once with a relatively small project when I didn&#8217;t want to deal with the headaches of MySQL replication, and it worked pretty well.</p>
<p>The trick is to take advantage of XFS&#8217;s support for snapshots. Basically, a snapshot of a drive can be taken at an exact INSTANT and survive for long enough for a dump to be taken from it. So instead of:</p>
<p>-locking all tables/databases<br />
-dumping all data (which, as you said, can easily take 15+ seconds)<br />
-unlocking all tables/databases</p>
<p>You can just:</p>
<p>-lock all tables/databases<br />
-take an XFS snapshot (which usually takes &lt; 2 seconds)<br />
-unlock all tables/databases (freeing up the DB to handle requests)</p>
<p>Then, at your leisure,<br />
-launch a secondary MySQL server using the snapshot&#039;s DB data files<br />
-perform a dump from this secondary server<br />
-stop the secondary server and delete the snapshot</p>
<p>This frees up the DB server almost immediately, ensures atomized data, and avoids the effort of configuring and maintaining a replication setup (which, given MySQL replication&#039;s tendency to short-circuit, can definitely be a plus).</p>
<p>Setting up XFS isn&#039;t usually too difficult, although it&#039;s much easier to do when you already have a free partition. Most newer Linux kernels have no problem supporting it, and as far as I know, it performs pretty admirably.</p>
<p>-Lou</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Austin Siewert</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18326</link>
		<dc:creator>Austin Siewert</dc:creator>
		<pubDate>Thu, 04 Feb 2010 20:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18326</guid>
		<description>Touché, I didn&#039;t even think of larger databases and security issues! (never had to deal with them...yet)</description>
		<content:encoded><![CDATA[<p>Touché, I didn&#8217;t even think of larger databases and security issues! (never had to deal with them&#8230;yet)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris lea</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18324</link>
		<dc:creator>chris lea</dc:creator>
		<pubDate>Thu, 04 Feb 2010 20:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18324</guid>
		<description>@austinsiewert Yup, the mysqldumper tool is great for small databases. What I was going for here is applicable to larger databases that you can&#039;t sanely email around even when compressed, and I went ahead with the encryption step as well. If you don&#039;t have too much data, by which I mean email is a real option, and you&#039;re okay with the data being exposed over the wire then mysqldumper is absolutely an easier way to go. Just depends on the use case. Thanks for making a note of it though!</description>
		<content:encoded><![CDATA[<p>@austinsiewert Yup, the mysqldumper tool is great for small databases. What I was going for here is applicable to larger databases that you can&#8217;t sanely email around even when compressed, and I went ahead with the encryption step as well. If you don&#8217;t have too much data, by which I mean email is a real option, and you&#8217;re okay with the data being exposed over the wire then mysqldumper is absolutely an easier way to go. Just depends on the use case. Thanks for making a note of it though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Austin Siewert</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18322</link>
		<dc:creator>Austin Siewert</dc:creator>
		<pubDate>Thu, 04 Feb 2010 19:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18322</guid>
		<description>My bulletproof setup is MySQLDumper (http://www.mysqldumper.net/), very easy to setup and configure for backups with a cron job. 

I currently have a (mt) dv account with multiple sites that runs nightly at 3am, dumps the db&#039;s, zips &#039;em, and emails them to me. Quite nice, and like I said before, easy to setup.</description>
		<content:encoded><![CDATA[<p>My bulletproof setup is MySQLDumper (<a href="http://www.mysqldumper.net/" rel="nofollow">http://www.mysqldumper.net/</a>), very easy to setup and configure for backups with a cron job. </p>
<p>I currently have a (mt) dv account with multiple sites that runs nightly at 3am, dumps the db&#8217;s, zips &#8216;em, and emails them to me. Quite nice, and like I said before, easy to setup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Noel</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18318</link>
		<dc:creator>John Noel</dc:creator>
		<pubDate>Thu, 04 Feb 2010 15:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18318</guid>
		<description>A nice article with a lot of info in it. The only thing I&#039;d point out is that in the script you&#039;re currently doing two writes to the filesystem when creating the compressed backup. If you use bzip (not sure whether gzip does stdin compression) you could change lines 91 - 95 to:

$MYSQLDUMP --opt --databases $DB_NAMES &#124; $BZIP2 -c &gt; $DUMPDIR/$IBACKUP_DEST-$DATE.mysql.bz2

This means if you have a particularly large database backup you&#039;re not hitting the disk with a large file and then freeing it up immediately. I&#039;m also not about to advocated bzip over gzip but I&#039;ve found better compression with bzip and my backups.</description>
		<content:encoded><![CDATA[<p>A nice article with a lot of info in it. The only thing I&#8217;d point out is that in the script you&#8217;re currently doing two writes to the filesystem when creating the compressed backup. If you use bzip (not sure whether gzip does stdin compression) you could change lines 91 &#8211; 95 to:</p>
<p>$MYSQLDUMP &#8211;opt &#8211;databases $DB_NAMES | $BZIP2 -c &gt; $DUMPDIR/$IBACKUP_DEST-$DATE.mysql.bz2</p>
<p>This means if you have a particularly large database backup you&#8217;re not hitting the disk with a large file and then freeing it up immediately. I&#8217;m also not about to advocated bzip over gzip but I&#8217;ve found better compression with bzip and my backups.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Palmer</title>
		<link>http://thinkvitamin.com/code/bulletproof-backups-for-mysql/#comment-18317</link>
		<dc:creator>Dan Palmer</dc:creator>
		<pubDate>Thu, 04 Feb 2010 14:03:04 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=4365#comment-18317</guid>
		<description>As a beginner web developer with no experience in this sort of thing, this will be really useful. Thanks!</description>
		<content:encoded><![CDATA[<p>As a beginner web developer with no experience in this sort of thing, this will be really useful. Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.634 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-11 19:57:09 -->

