How to Backup Wordpress Database with phpMyAdmin

January 11, 2008 by Gurmit Bal

Did you know that if you are running your blog or website on Wordpress, all your data including any posts, pages, comments etc. is stored on mySQL database? In other words, any web site created with Wordpress is dynamic - the pages are created on the fly. How does Wordpress do that? The Wordpress does that by using mySQL database as the back-end.

In a typical static HTML website all HTML pages are individually created and stored on the web server itself. Whenever a user (browser) requests an HTML page, the web server passes that page to the browser. Thus if one of the pages in an HTML web site gets damaged or accidentally deleted, you only lose that one page. That is not the case with Wordpress.

In a Wordpress powered web site, no individual pages are stored on the web server. Instead all data is stored on a mySQL database. So when a user browser requests a page, Wordpress gets all the info about that page from the mySQL database, constructs the page and presents it to the browser. If for any reason the mySQL database gets damaged or corrupted so that Wordpress is unable to read info from the database, your whole web site may be lost!

Thus it’s very important to backup the mySQL database used by Wordpress on a regular basis. This article discusses how you can backup your database by using phpMyAdmin in cPanel. Simply follow these steps:

  1. Log in to your cPanel control panel. If your website control panel/interface is different from cPanel you can still use this procedure so long as you know how to get to phpMyAdmin through your control panel.
  2. Once you are logged in the cPanel, look for MySQL icon as shown below. mysql image
  3. Click on the MySQL icon as shown in the above image and you will get to the screen labeled MySQL Account Maintenance. It gives you information about your MySQL databases and users etc. Scroll down and you’ll see the label phpMyAdmin as shown below.
  4. Click on the phpMyAdmin label and a new phpMyAdmin window will open. This phpMyAdmin window will have information about your databases, tables etc. Look for the Databases label (see the arrow that I made in the image below) and click on it.
    phpmyadmin
  5. Once you have clicked the Databases label in step 4, the next screen will show the names of all the Databases in your account. If you see only one Database listed then that is the one that was created when you installed Wordpress, click on it. But if you see more than one Databases listed then you need to click on the one that belongs to Wordpress; that will be the Database you created when you installed Wordpress.
  6. Once you have clicked on the Wordpress Database in step 5, the next screen will show the tables in your Wordpress database. You don’t need to check any tables here. Instead look at the top labels and you’ll see the ‘Export‘ label among others as shown in the image below. export database
  7. Click on the Export label as shown in the above image and you will get a screen which has several sections and you’ll need to make several selections on this screen. I’ll explain each section of this screen below:
    Export Section
    The export section is shown in the image below.
    export section of database
    In this section select all the Wordpress tables. By default, the Wordpress tables are named as wp_tablename unless you have intentionally specified something different for table_prefix in your wp-config.php file. If Wordpress is the only application that uses your database then all tables shown in this section belong to Wordpress and they will automatically be selected when this screen is opened. In case the tables are not selected, you can easily select them by clicking on the Select All label. Also make sure to select SQL as shown in the image above.
    Options Section
    This section is shown in the image below.
    options section of database
    Under this section make check marks on: Structure, Add Drop Table, Add Auto-increment value, Enclose table and field names with backquotes, Data. All these check marks are shown in the image above.
    Save as File Section
    In this section make check mark on Save as File and select Compression as None as shown in the image below.
    save as file option of database
    Double check to make sure you have fully completed this step (#7) and checked all the boxes as shown in the images above.
  8. Once you have completed step #7 above, click on the Go button located towards the bottom right and you will be prompted to download the file and save it to your computer.
  9. Select the folder where you want to save this file on your computer and the download will begin. Depending on the size of your database, the download may take a while to complete. Once the download is complete, you have backed up your Wordpress database on your computer.





Stumble it!      Subscribe to my feedSubscribe to my Feed in a reader

Post a Comment