28 Jan January 28, 2015

Manually Backing Up Your WordPress Site – Part 2: Database

Michael Murphy 0 Tutorial, WordPress

Backing up Your WordPress Site Database

In last weeks blog post, Manually Backing Up Your WordPress Site – Part 1: Files, we discussed how to backup the files associated with your WordPress website. The second, and final step, is to backup your WordPress site’s database.

Your WordPress database contains every post, image, comment and link you have on your site. It is an essential component of your site’s manual backup. Your site’s files alone does not a full recovery make – you must also have the database backed up.

When you forget to backup your WordPress website’s database you are almost guaranteed to feel like this woman:

Michael the Tech Guy | Frustrated Female

phpMyAdmin… what?

phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. In more easily-digested terms, phpMyAdmin is the tool we will be using in this tutorial to backup our WordPress database.

phpMyAdmin is available as a free download stand-alone application, or is included in most every web host’s cPanel options. In this tutorial we will be showing you how to run phpMyAdmin from your site’s cPanel.

Open phpMyAdmin

We will begin by opening up the phpMyAdmin application. You will want to be logged into the site’s web host, and in the cPanel. Locate the phpMyAdmin icon in the cPanel and click on it to run the application. The phpMyAdmin icon is generally found in an area called “Database Tools”, or something very similar, in the cPanel.

See the image below for visual directions.

Michael the Tech Guy | Open phpMyAdmin

You will most likely need to provide your site’s login information to open the phpMyAdmin application at this point.

Choosing the Correct Database

Next we will locate the correct database to backup. This step is much easier if you are not hosting multiple sites on your account. More to follow on this.

Click on the Databases tab as shown in the example below.

Michael the Tech Guy | phpMyAdmin Dashboard Select Databases

The next screen (pictured below) allows you to choose which database you will backup.

In our example image you’ll see three databases listed. This number is dependent on the number of sites you host on the account in question. If you only host one site on the account you can skip ahead to the Export the Database step below.

Michael the Tech Guy | Select Database to Export

If you host multiple sites on your account and are unsure which database name matches which site, have no fear. The following few steps will help you identify the proper associations.

Matching a Database Name to a Site

To begin this identification process, open the File Manager application located in your hosting account’s cPanel. Within the cPanel you should see a section called File Management, or something very similar. Locate the File Manager icon and click on it to run the application.

See the image below for visual directions.

Michael the Tech Guy | Select File Manager

Clicking on the File Manager icon will open the File Manager Directory Selection window. For the purposes of tutorial you you will want to make sure you have chosen the directory Web Root (public_htlm/www). With that selected, click the Go button to enter the File Manager.

See the image below for visual directions.

Michael the Tech Guy | File Manager Directory Selection

You will need to locate the wp-config.php file for each of the sites hosted on your account.

It is important to note that EACH site hosted on you account will have it’s own wp-config.php file. The wp-config.php file resides in the root directory of the site it is associated with.

For example, the wp-config.php file associated to the main (first) site hosted on the account can be found in the public_html folder. Each additional site should have it’s own sub-folder off public_html and their associated wp-config.php files will be found there.

Highlight the wp-config.php file, and click the View button at the top of the File Manager window. This will open the wp-config.php file and allow you to view it’s contents.

See the image below for visual directions.

Michael the Tech Guy | Select wp-config.php and View

Time Saving Tip: as you map the database names to their sites, make a written note of the association. This will keep you from having to repeat the identification steps the next time you perform a manual backup of your database.

Once the wp-config.php file is viewable you can proceed with the following steps.

You will need to locate the following code snippet:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'ichaeoc2_wor5642');

The define (‘DB_NAME’ line identifies the database name associated to this site. In our example the database name is wor5642.

Repeat these steps for each site hosted on your account to identify their database names.

See image below for visual directions.

Michael the Tech Guy | Locate Database Name

Export the Database

With the proper database highlighted (see Choosing the Correct Database step above) click on the Export tab as shown in the image below.

The image below shows ONLY the default tables listed in the Structure view tab. You may have more tables – possibly many more.

Michael the Tech Guy | Choose Export for Database

In the following window you want to ensure the Export Method is set to Quick. In addition, the Format needs to be set to SQL. After ensuring the settings are correct, click the GO button.

Reference the image below for the proper settings for this step.

Michael the Tech Guy | Database Export Settings

Voila! You have now backed up your WordPress site(s) database. Well done my friend.

The database file will have been saved in your default download location. The filename will be the same as the database name with the SQL extension.

If you are following this tutorial after completing its companion post, Manually Backing Up Your WordPress Site – Part 1: Files, you will want to save the SQL file you just created in the Database sub-folder you created previously.

Such as in the image below.

Michael the Tech Guy | Archive Database Backup

Zip It and Cloud It!

At Michael the Tech Guy, our final step is to zip the folder that contains both the files and the database and upload them onto our Google Drive. I’ll leave this level of super-backupness to you.

Further Down the Rabbit Hole

Michael the Tech Guy | Cheshire Cat

Here are some useful links if you would like to dig deeper into backing up your WordPress database.

Be sure to look for last week’s post, and companion to this article:
Manually Backing Up Your WordPress Site – Part One: Files.

Here are some links to tutorials to help you locate phpMyAdmin in the cPanel of some of the most popular web hosting services:
Bluehost | GoDaddy | HostGator

You can download the free phpMyAdmin client at this link:
http://www.phpmyadmin.net/home_page/index.php

For more detailed information about the WordPress backups, please reference this link:
http://codex.wordpress.org/WordPress_Backups

Nothing makes us happier at Michael the Tech Guy than when you take the time to read our blog. Learning to manually back up your WordPress website is an important skill. If you have any comments, questions or requests for new blog topics, please contact us at mmurphy65@gmail.com

We Invite You To Share Our Work Freely:

Facebooktwittergoogle_plusredditpinterest

Leave a Reply

Your email address will not be published. Required fields are marked *