Guide: Backing Up Your WordPress Database
Feb 24, 2009 | Comments 5
Backing up your WordPress Database is the most important procedure you need to do when running your own blog. The database stores all your posts, comments, pages, links and all other settings. This guide will show you detailed instructions on backing up your precious data.
Also to note - This guide is used for backing up your database only, this does not include backing up your uploaded images, media, plugins or WordPress installation. I will create another guide on that subject soon.
One of the most popular ways of backing up your database is by using phpMyAdmin, which is included with most webhosts nowadays.
First you need to find out your database name. To do that you need to open the wp-config.php which is in the root of your WordPress directory on your server.
You will need to find the following line:
define('DB_NAME', 'wordpress'); // The name of the database
Your database name will be located where the word ‘wordpress‘ is. Remember the database name.
Log into phpMyAdmin. If you don’t know how to access phpMyAdmin, just contact your webhost.
Once logged in you should see a page that resembles below. On that page you need to click on the link that says Databases.
The next page will give you a list of databases that are being used, click on the link with your database name. Example in the picture below:
You will now be presented with a new page that has a list of WordPress tables, you need to click the Export link at the top of the page. Example picture below:
The page that comes up is where you change the settings for your database. This section is the most important part of creating a database backup.
The left box shows some Export settings, in that box you need to highlight all the tables by clicking the ‘Select All‘ button. Then scroll down and make sure ‘SQL‘ is selected. Example picture below:
On the right under Options you need to make sure the first two options are unticked. The two options are listed below:
- Enclose export in a transaction
- Disable foreign key checks
The Structure option on the right hand side of the page needs to be ticked and also the following three options below:
- Add DROP TABLE / DROP VIEW
- Add AUTO_INCREMENT value
- Enclose table and field names with backquotes
To make things easy just use all the same settings that are used in the screenshot below:
In the Data section you need to have everything unticked except for the Data option. Example in the screenshot below:
Now for the final section at the bottom of the page you need to tick the ‘save as file‘ option and everything else can remain the same as seen in the screenshot below:
Following that four Compression options are shown, I like to use either ‘None‘ or ‘zipped‘ then hit the Go button in the bottom righthand corner then your database download will start.
I hope this guide has come in handy for some people, the last thing anybody ever wants is to lose a years worth of posts and hard work. We will put together a guide on restoring a database soon, that will come in handy for those who are moving servers or are just restoring a database due to it being corrupt.
One other way of backing up your database for safe keeping is by using a WordPress plugin called WP-DB-Backup and your database can be saved from within your WordPress Administration Panel. More information about the WP-DB-Backup plugin can be found here.










Apparently 2.8 will include WP-DB-Backup. A Wordpress survey a few months back was asking if everyone wanted WP-DB-Backup plugin to be packaged with WP.
http://wordpress.org/development/2008/12/prioritizing-features-for-wordpress-28/
Yeah I hope it will be included. WP-DB-Backup will make things a lot easier for noobs.
Is noob a bad thing? I’m probably a noob…
Nowadays noob means pretty much ‘less experienced’, everyone is a noob at one stage or another. I don’t class it as a bad thing
Very useful article. Thank you.