<?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>Fortasse &#187; tutorial</title>
	<atom:link href="http://www.fortasse.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fortasse.com</link>
	<description>Action at a distance</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:55:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>MySQLDump: MySQL Backup Tutorial</title>
		<link>http://www.fortasse.com/tutorials/mysqldump-mysql-database-backup/</link>
		<comments>http://www.fortasse.com/tutorials/mysqldump-mysql-database-backup/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 20:09:31 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.fortasse.com/?p=1141</guid>
		<description><![CDATA[If your database goes, in most cases you’ll have nothing. Zilch. Zero. Nada. No posts, no users, no links, no tags. Luckily, we can back it up!]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.fortasse.com/wp-content/uploads/2011/04/Logo-mysql.jpg"><img class="alignright size-medium wp-image-1142" title="MySQL Logo" src="http://www.fortasse.com/wp-content/uploads/2011/04/Logo-mysql-300x218.jpg" alt="MySQL Logo" width="300" height="218" /></a></h3>
<h3>Back it up!</h3>
<p>Backing up your database is a very important step in preventing the mayhem that could ensue if you have issues with your server in the future. If your database goes, in most cases you’ll have nothing. Zilch. Zero. Nada. No posts, no users, no links, no tags. You get the point. Thankfully, this is fairly easy to do using a shell script.</p>
<h3>Instructions</h3>
<p>You may have problems copying and pasting the code into your text editor. Windows uses a different format for carriage returns than Linux, so use a Linux-compatible editor or convert the saved file with dos2unix. <strong>If you have problems, please use the first set of instructions!</strong></p>
<ol>
<li>Create a directory called ‘database’ inside your /html/backups directory (your directory structure may differ).</li>
<li>Download the backupdb.sh file at the bottom of this post and put it in the /html/backups directory.</li>
<li>Set the folder permissions to this directory as 0700 (if you get  permission errors, try 0755 or 0777, but password protect your  directory).</li>
</ol>
<p>-or-</p>
<ol>
<li> Create a directory called ‘database’ inside your /html/backups directory (your directory structure may differ).</li>
<li>Create an empty file called backupdb.sh and put it inside the /html/backups directory.</li>
<li>Set the folder permissions to this directory as 0700 (if you get permission errors, try 0755 or 0777, but password protect your directory).</li>
<li>Copy and paste the following code into the bottom of the backupdb.sh script:</li>
</ol>
<p><code>#!/bin/bash<br />
#Compliments of www.fortasse.com<br />
#Displays a greeting and backs up files<br />
#Begin Script<br />
TERM=linux<br />
export TERM<br />
NOWDATE=`date +%m%d%y` # Sets the date variable format for zipped file: MMddyy<br />
clear # clears terminal window<br />
echo<br />
echo "Backing up WordPress database"<br />
mysqldump -h YOUR.DBSERVER.COM -uUSERNAME -pPASSWORD DATABASENAME &gt; $HOME/html/backups/database/$NOWDATE.sql<br />
gzip -9 $HOME/html/backups/database/$NOWDATE.sql<br />
echo<br />
echo "Job finished!"</code></p>
<h3>Customization</h3>
<p>Replace YOUR.DBSERVER.COM with wherever your database is stored. It might be locally stored on the machine, or it could be located on a remote server in the case of Godaddy. Replace USERNAME with your username, PASSWORD with your actual password and DATABASENAME with the name of the database you want to backup. Keep the spaces, all dashes and everything else you see intact. -p and PASSWORD are supposed to be connected. Do not make a space between them, or it may not work. Like the file backup script, this will back up the database, zip it and put it in an archive with a time stamped file name.</p>
<h3>Final steps</h3>
<p>You will need to set this script to run through your hosts CRON Job manager. In Godaddy, this is a very simple task. You need to upload the script, open up your Hosting Control Center, go to Cron Jobs and select the file and time you wish to run the shell script. NOTE: You may get a ‘Permission Denied Error!’ In this case, try setting the permissions of the backup.sh file to 755.<br />
Summary</p>
<p>So to briefly summarize everything, the script backs your SQL database and zips it in a nice little time-stamped file using gzip. Simple enough, huh?</p>
<br>
<br>
<br>






<div class="download-info single">


<div class="side-section">
		        		<p><br><iframe src="http://rcm.amazon.com/e/cm?t=fortasse-20&o=1&p=8&l=ez&f=ifr&f=ifr" width="120" height="240" scrolling="no" marginwidth="0" marginheight="0" border="0" frameborder="0" style="border:none;"></iframe>
</p><div class="extra"></div>
<p><a href="http://www.fortasse.com/wp-content/plugins/download-monitor/download.php?id=3" class="download-button">Download</a></p>		        	</div>



<div class="main-section">



<br>
<h1>Download: MySQL Database Backup</h1>







<table class="download-meta" cellspacing="0" style="width:100%">

<thead><tr><th scope="col">Attribute</th><th style="text-align:right" scope="col">Value</th></tr></thead><tbody>

<tr><th scope="row">Version</th><td style="text-align:right">1.0</td></tr><tr><th scope="row">Date posted</th><td style="text-align:right">Apr 28, 2011</td></tr>

<tr><th scope="row">Downloaded</th><td style="text-align:right">314 times</td></tr><tr><th scope="row">Tags</th><td style="text-align:right">godaddy, mysqldump, backup, database, mysql</td></tr>

<tr><th scope="row">File format</th><td style="text-align:right">.7z extension</td></tr>




</tbody></table>


<div class="download-desc">
<h3 class="download-desc-heading">Description</h3>
<p><p>Multiple hosting provider compliant database backup script which uses MySQLDump; exclusively designed to work with Godaddy in mind.</p>
</p>

<p>You must be registered to download! If you are not, please <a href="http://www.fortasse.com/wp-login.php?action=register">Sign Up</a> now!</p>






<p></div></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fortasse.com/tutorials/mysqldump-mysql-database-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

