Two ways to Backing up WordPress

If you are a serious blogger, you must know WordPress. WordPress is the most popular blogging tools all over the world. It is written in PHP and uses MySQL database to store the articles and the comments, etc. More and more people use WordPress to build their own blogs. If you don't like your hosting company and want to buy another one, first you need to backup all articles in your WordPress. In this article I will show you two ways to backup your articles in WordPress.

Method 1. Exporting and Importing

In this way you don't need to install any plugins or operate the database directly. WordPress supports exporting and importing. The function exporting can save all the articles into an XML file and you can download it, and importing and "restore" from the XML file to another WordPress. Now let's have a look.

Login to your WordPress and go to "Manage" -> "Export". In "Restrict Author", select "All authors" to export all the articles. Then click "Download Export File" to download the XML file. This file contains all the articles in your WordPress.

WordPress Export

WordPress Export

To restore, go to "Manage" -> "Import". Here you can see a list of blogs. WordPress can import articles from many blog systems. The last one is "WordPress". Click it and upload the exporting file. After a while, all the articles, comments, categories, etc are imported to your new WordPress.

WordPress - All posts

WordPress - All posts

Method 2. Use "WordPress Database Backup" Plugin

WordPress exporting just export the core information such as the articles, comments, tags, and categories. If you installed some plugins like WP-Poll which created some tables in the database. "Exporting" won't export the data in the additional tables. If so, you need to backup the database instead of just using "exporting" and "importing". However, backing up the database is a little difficult for new uses. So I recommend to use "WordPress Database Backup" plugin.

To install the plugin, download it and upload the directory to the WordPress wp-content/plugin/ directory. Then activate it in the WordPress -> Plugins. It will create a sub menu "Backup" in the "Manage" menu. In the "backup" page, you can see which tables are in your WordPress database and you can decide which tables to be backed up. In the "Backup Options" you can choose where to save the backup file, saving it in the server, downloading it or sending it to your Email. In this example, I choose "Download to your computer". Then click "Backup Now" to start the backup process. After a while, you can download the file.

The backup file is a compressed SQL file. Therefore, to restore from this file you should upload the file to your server and login to the server's shell with your SSH account. Then execute the following commands:

gunzip <WP-DB>.gz
mysql -u <USER> -p <DATABASE> < <WP-DB>

Here, <WP-DB> stands for the backup file name, <USER> means your database username and <DATABASE> means the database name of your WordPress.

Problem: How do I do if I don't have an SSH account?

Some hosting plans don't support SSH so you cannot login to your server's shell. But usually it provides phpMyAdmin, an web interface for operating MySQL. You can login to phpMyAdmin and choose your WordPress database, then open "Import" menu. In this page you can choose the SQL file and import it to the database.

Click here to download "WordPress Database Backup" Plugin.