Wordpress BackupsWeb Development, Software Development, SEO Company
Wordpress Backups
Web Development Company Contact Us Web Development Company Contact Us
Web Development Company Contact Us
Web Development QuoteSoftware Development Quote
"The way to be safe is never to feel secure."
– Unknown
Web Design QuoteQuote Relevant to Software Development
Web Development, Software Development Company - Remember Us


ENSURE WORDPRESS BACKUPS CAN BE RESTORED SUCCESSFULLY BEFORE YOU ADD ANY CONTENT!!!

Before you add any Wordpress content you MUST ensure that a backup and restore process is in place. The importance of this cannot be over-emphasized. Every hour that you spend adding content to your website can be erased if the database crashes – databases do crash, and this is fair warning.

Before adding content make sure that your website administrator has a backup scenario in place and that regular backups have been verified.

MANUAL BACKUPS
To perform manual full or partial MySql database and file backups you can go into the website cPanel and click the Backup Wizard in the Files section then select the backup options you want. A full backup backs up everything about the site including email configurations and all site files. Partial backups can include one or all of the following:
Home directory
MySql databases
Email Forwarders and Filters

When these backups are performed they will be placed in the root folder of the website:
/

To extract (and possibly restore) only the Wordpress database file you need to open the tar file that is backed up and extract the .sql file in the .\mysql\ folder. A typical file is named domainsp5_sswp01.sql.

AUTOMATIC SITE BACKUPS
This is our normal automatic backup process:
Backup Wordpress MySql Database – to automatically backup the WordPress MySQL database (and all other website MySQL databases) at BlueHost.com we run a Wordpress backup script named backupDatabases.sh that resides in the root folder of the website. You must set the permissions of the Owner user for this file to allow executes. This requires a security setting of 744. This backup script is usually run daily unless a lot of content is being added in which case we’ll run it 4 times a day. To run the script automatically you need to create a CRON job for it. CRON jobs are explained below. The backups it creates are located in this folder of the website:
/backup/mysql/

CRON JOBS
A CRON job is simply a scheduled task in Linux or any Unix-based machine.

You can run CRON jobs from your cPanel (Advanced – last section at the bottom of the page) to execute the first set of backups described above. You can change the frequency of these backups by clicking the CRON Jobs icon.

Don’t forget to enter your email address when you define a CRON job so you can receive notifications when it runs.

Wordpress MySql Database Backup Script

The backup script described in this page allows you to create automatic backups of your MySql database when you use it in a CRON job.

All of the content below the line under this sentence with all ### should be copied to a file named backupDatabases.sh. Once this is done you need to do the following to set up your automatic database backups:

  1. Change the user and pass variable values in the Configuration settings to the login values for your website control Panel.
  2. Place the file into the root folder of your website account (this may not be your website root folder).
  3. Using your FTP client change the permissions of this file to 744 so it can be executed by the site Owner user.
  4. Refer to this file in a Linux CRON job and specify how often you want your MySql database backed up.
  5. Test it. Make sure that the files are actually created. This is important to the well being of your website. If you have problems see the troubleshooting page.

Note that the files are placed into this folder of your website:
/backup/mysql/

##################################

#!/usr/bin/env bash
#======================================================
#
# FILE: backup_db.sh
# USAGE: ./backup_db.sh password
# DESCRIPTION: Backup all my databases one by one
# VERSION: 1.2-STABLE
# CREATED: 11/28/08 11:42:00 MST
# REVISION: —
#======================================================
#——-Configuration Settings——-#
user=”CPUsername”; #A Database User with Privileges on all dbs
pass=”CPPassword”; #Said user’s password !!
#—–Don’t Edit Below This Line—–#

if [[ `uname` = "Linux" ]];
then
expath=”/usr/bin”;
mystat=”stat -c %Y”;
fi;

if [[ `uname` = "FreeBSD" ]];
then
expath=”/usr/local/bin”;
mystat=”stat -f %B”;
fi;

ts=`date +%s`; #For the file timestamps
d=`date +%Y%m%d-%H%M`; # For other uses
month=2592000; #One month
#month=178200; #2 days For testing
dir=”$HOME/backups/”; # Directory to store the backups
if [[ ! -d $dir ]]; #Make sure the dir exists and create if not.
then
mkdir -p $dir;
fi;

# First let’s prune the backup dir of files over a month old
cd $dir;
for l in `ls $dir`;
# Works CentOS and Ubuntu…
do mt=`$mystat $l`;
result=$(($ts-$mt));
#echo $result;
if ((“$result” >= “$month”));
then
echo “Deleting: $l”;
rm -f $l;
fi;
done;

# Let’s do this
for i in `echo “show databases” > $expath/mysql -u$user -p$pass > grep -v Database`;
do var=${i}${d};
$expath/mysqldump -R -p$pass -u$user $i > $var.sql && echo $i backed up on $d;
done;
#————————

Bookmark and Share
Testimonials - Web Development, Software Development, SEO
Testimonial:
"I would highly recommend Michael Cordova as an expert in website search engine optimization, web design and web development. Michael is the best SEO / Internet marketing consultant I've ever met. His work to optimize the TransMagic website not only produced an 8-fold increase in lead generation, but it also stood the test of time. Now in 2008, Michael helped us to re-do our SEO to take advantage of more sophisticated techniques in his knowledge base."
Todd Reade, CEO
TransMagic, Inc.
Transformational SEO, Software Development
Web Development Software Development Firm
  • Wordpress Backup Automation

  • Wordpress Backup Script

  • Wordpress MySQL Backups

  • Wordpress Backup Cron Jobs

teaser paper edge
content edge
Web Development, Software Development Company - Remember Us
Web Design Guide
Support your branding and sales efforts, streamline your operations with an invaluable Web Design Guide, Checklist.

Software Development Firm - W3C XHTML Strict Compliant Web Development Firm - W3C CSS Compliant Accessibility Compliance for Section 508, WCAG Priority 1, 2 and 3 - Cynthia Tested!Level Triple-A conformance icon, W3C-WAI Web Content
Accessibility Guidelines 1.0