21st Century Technologies, Inc.

Custom Database Software Development, Online Marketing

Custom Database Software

Business Marketing/Local SEO

Conversion Rate Optimization & Lead Gen

  • Home
  • Testimonials
  • Portfolio
  • Case Studies
  • Blog
  • About Us
    • Company Overview
    • Privacy Policy
    • Terms of Use
  • Contact Us
  • Web Design/Development
    • Mobile Websites
    • Web Design Checklist
    • 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
  • Conversion Rate Optimization/Lead Gen
    • Engagement Marketing
  • Software Development
    • Turn Spreadsheets and Paper Forms into a Mobile Database App
    • Software Development Services
    • Software Development Guide, Checklist
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;
#------------------------

25+ Years in Business!

25+ Years in Business

Michael is a Wordpress Expert

See Details

Software Dev Testimonial

“I highly recommend 21st Century Technologies and Michael Cordova. Michael has successfully built and delivered several in-house custom database software systems for my company, and multiple customer-facing software projects. I have known Michael for over 15 years. His character and reputation are outstanding. Michael has always enhanced our business’s reputation and helped to ensure the successful completion of each project. He has always been very attentive to the needs of our clients and has represented our company well.”
James P. Greichen, President, Triportals, Inc.

Author Productivity Tools For Business

Author Productivity Tools For Business

Outstanding Testimonial

“Michael Cordova has a commanding knowledge of several software development languages. For over ten years I have relied on Michael’s expertise and worked with him on projects. He is the first person I call for an opinion on a perplexing problem or when considering a new methodology. I highly endorse any work that he is involved in. He is reliable and delivers high quality work well within established deadlines. I have and will always consider Michael on any project needs. I highly recommend his talents to anyone with any type of software development needs.”
Vernon Kercher, Senior Application Developer, Western Union

Your Technology Partner

Have 21st do your software design and development or online marketing and advertising and you will inherit a technology partner. We have been doing it since the beginning of the WWW. We are uniquely qualified to provide technology solutions.

Outstanding CEO Testimonial

“I would highly recommend Michael Cordova as an expert in website search engine optimization, web design and software 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…

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

Local SEO Marketing

Local SEO/Small Business MarketingLocal SEO gets your site ranked at the top of Google's local listings. Your online presence is expanded dramatically, and the sale is already made before your prospects call you. Read more about our local SEO services.

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.

Your Technology Partner

Have 21st do your software design and development or online marketing and advertising and you will inherit a technology partner. We have been doing it since the beginning of the WWW. We are uniquely qualified to provide technology solutions.

Copyright © 2023 · 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