21st Century Technologies, Inc.

Custom Database Software Development, Online Marketing

Mobile, Desktop Database Apps

Business Marketing/Local SEO

Conversion Rate Optimization & Lead Gen

  • Home
  • Testimonials
  • Portfolio
  • Case Studies
    • Case Studies S/W Development, Web Design
    • We Combined Web Hosting to Maximize Performance for $11.31/Month
    • WordPress Tutorial – SEO Optimized CMS Installation Case Study
      • About WordPress Video Tutorial – How To Use WordPress
      • WordPress Tutorial – WordPress Installation
      • WordPress Tutorial – SEO, CMS Configurations
      • WordPress Tutorial – WordPress Backups
      • WordPress Tutorial – WordPress Content Management
      • WordPress Tutorial – Integration of a Custom WordPress Web Design
  • Blog
  • About Us
    • Company Overview
    • Privacy Policy
    • Terms of Use
  • Contact Us
  • Newsletter Signup
  • Web Design/Development
    • Mobile Websites
    • Web Design Checklist
    • Get Website Traffic & Conversions White Paper
    • Full Service SEO Friendly Web Design
    • SEO Web Design
    • Web Design Portfolio
  • Local SEO Marketing
    • Small Business Marketing/Local OFFER
    • Online Review Management
    • Local SEO Marketing Services
  • Business Marketing
    • Online Marketing/SEO
    • Local Small Business SEO Marketing Services Bring Customers Through Your Front Door
    • SEO / SEM Services
    • Google My Business
    • SEO Web Design
    • Free Advertising Websites Top 10 List
  • Conversion Rate Optimization/Lead Gen
    • Get Website Traffic & Conversions White Paper
    • Engagement Marketing
  • Software Development
    • Turn Spreadsheets and Paper Forms into a Mobile Database App
    • Software Development Services
    • Software Development Guide, Checklist
    • FREE Batch Image Processing Software
You are here: Home / Case Studies – Transformational Software Development / WordPress Tutorial – WordPress Backups

WordPress Backups

Ensure WordPress Backups Can Be Restored Successfully Before You Add Any Content You Don’t Want To Lose!!!

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;
#------------------------

Let’s Start the Mobile-Friendly Website Conversation

    Name *

    Email *

    Phone

    Comments


    Selected Top Web Design Agency

    Selected Top Web Design Agency

    Outstanding CEO 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. Recently Michael helped us to re-do our website and SEO to take advantage of more sophisticated techniques in his knowledge base.
    --
    Todd Reade, CEO
    TransMagic

    Many More Testimonials...

    Bigger and Better Leads

    I have been working with 21st Century on my SEO work for well over a year and the results are larger prospects and bigger opportunities for my company.
    --
    Gina Kaelin-Westcott, Sales Strategist/Speaker/Author
    Con·nect Selling™

    Many More Testimonials...

    Selected Top 10 SEO Company!

    #9 SEO Company in the World!

    Outstanding CEO Testimonial

    I have worked with Michael for almost three years now and he has never ceased to amaze me. I’ve worked with a number of SEO people over the years and he puts them to shame. He is simply the best of the best. He’s done more for our site in a few months than other people have done in years. His knowledge of WordPress is quite impressive. I highly recommend Michael Cordova to build your WordPress websites and bring in sales leads for you through SEO and other online marketing means.
    --
    Pedram Shojai, CEO
    Well.org


    Many More Testimonials...

    57 Productivity Tools for Entrepreneurs, Students and Business

    Our President Michael Cordova's eBook will multiply your daily effectiveness immediately:
    57 Productivity Tools for Entrepreneurs, Students and Business

    57 Productivity Tools for Business, Websites and Application Development

    Local SEO Marketing

    Local SEO/Small Business MarketingLocal SEO gets your site ranked at the top of the the top search engines local listings. When done right you are in the "A" position and your sales skyrocket. See our local small business FREE offer.

    Mobile Websites

    Mobile Websites Are Now RequiredAfter Google's Mobilegeddon algorithm change to recognize the importance of mobile devices, mobile friendly websites are now absolutely required. Read about Mobilegeddon and how we can build your mobile website.

    Web Development

    Web Development - Since the Beginning of the InternetWe at 21st have been doing web development since the beginning of the Internet. We create custom applications like maps, contact management and website customizations that are beyond the skills of other companies.

    Software Development Checklist

    Download our Software Development Checklist to ensure you make no mistakes in your custom software project. See our many short custom software case studies for an idea of the breadth of our software development successes.

    Copyright © 2021 · 21st Century Technologies, Inc. All rights reserved. · Contact Us

    21st Century Technologies, Inc.
    1566 S. Pennsylvania St. Denver, CO 80210
    303-744-2178
    WordPress Tutorial – WordPress Backups - Denver, Colorado