Backing Up Your Wordpress or Any MySQL Database
Posted by RAJU K, Last modified by RAJU K on 10 September 2012 01:03 AM

It is strongly recommended that you backup your database at regular intervals and before an upgrade.

Backup using cPanel X

cPanel is a popular control panel used by many web host. The backup feature can be used to backup your MySql database. Do not generate a full backup, as these are strictly for archival purposes and cannot be restored via cPanel. Look for 'Download a MySQL Database Backup' and click the name of the database. A *.gz file will be downloaded to your local drive.

There is no need to unzip this file to restore it. Using the same cPanel program, browse to the gz file and upload it. Once the upload is complete, the bottom of the browser will indicate dump complete. If you are uploading to a new host, you will need to recreate the database user along with the matching password. If you change the password, make the corresponding change in the wp-config.php file.

Using phpMyAdmin

phpMyAdmin is the name of the program used to manipulate your database.

Information below has been tried and tested using phpMyAdmin versions 2.5.3, 2.5.7-pl1, and 2.6.1-pl3 running on Unix.

Detailed options are listed below, though in most cases you will be fine with the default export options.

Backup Process with phpMyAdmin

  1. Log into phpMyAdmin on your server

  2. From the main login screen, select 'Databases'
  3. (You may not need to do this step)

    Image:podz_backup_1.jpg

  4. Now click the name of your database - or your WordPress database if you have several databases.
  5. (Your screen may look slightly different, depending on the version.)

    Image:podz_backup_2.jpg

  6. The next screen will show you all the tables inside your WordPress database.
    Ignore those, and click the 'Export' tab on the top set of tabs.
  7. Image:podz_backup_3.jpg

  8. Look at the left box at the top of the Export section. All the tables in the database you selected are in that box.
    • If you have other programs that use the database, then choose only those tables that correspond to your WordPress install. They will be the ones with that start with "wp_" or whatever 'table_prefix' you specified in your 'wp-config.php' file.
    • If you only have your WordPress blog installed, leave it as is (or click 'Select All' if you changed the selection)
    • Ensure that the SQL radio button is selected.
  9. Image:phpMyAdmin_backup_export.png


    Image:Phpmyadmin_bentrem.jpg

  10. The SQL section
    • 'Structure'
    • 'Add DROP TABLE / VIEW / PROCEDURE / FUNCTION'
    • 'Add IF NOT EXISTS'
    • 'Add AUTO_INCREMENT' and
    • 'Enclose table and field names with backquotes'
  11. Tick the following boxes:
  12. The DATA section
  13. It doesn't matter too much what you check here. So long as you check the DATA box itself, the Complete inserts and Extended Inserts are mostly cosmetic changes to the output style, though Extended Inserts can help if you are having issues with the file size.



  14. Tick the 'Save as file' option, and leave the template name as is.
  15. Image:podz_backup_5.jpg

  16. Now click 'Go' and you should be prompted for a file to download. Save the file to your computer.
    Depending on the database size, this may take a few moments.

  17. You have now backed up your database.
  18. If you wanted, you could download a backup in each of the compression formats. Your choice. For example: None and "zipped": Image:podz_backup_6.gif

    Remember - you have NOT backed up the files and folders - such as images - but all your posts and comments are now safe.

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).