Web servers crash, and they can get hacked, with devastating results for websites. Given the amount of work you have put into your self-hosted WordPress blog, it is a good idea to make regular backups. This isn't as difficult as it sounds, and there are various ways in which you can do it.
slide 1 of 6
Is It Worth Backing Up My Blog?
Among the various regular tasks that you need to perform as the owner or manager of a WordPress blog are those related to backing up and archiving data. This might be simple a case of exporting all of the posts in RSS format from the blog dashboard or actively backing up and exporting the entire database from MySQL.
In addition to these tasks, you might be interested in retaining a copy of the blog theme and its various component files, such as images that have been uploaded.
While all of this might sound like a lot of hard work, it genuinely isn’t. However, for the continued long-term success of your blogging project, backing up your website at least once a week is a vital step that you should consider scheduling into your routine. It requires just a few minutes of interaction from yourself and can save you from a lot of headaches in the event of a data issue.
Let's take a look at how to back up WordPress!
slide 2 of 6
Basic Backup with RSS
If you don’t have permissions to access the MySQL database that stores the words and everything else important about your blog, your best option will be to use the export tool to save the posts to your computer.
You can do this easily from the WordPress Dashboard – look for Tools in the left-hand menu, and select Export. Here you can choose between All content (posts, pages, comments, navigation menus and more), Posts and Pages, and by clicking Download Export File you will instruct WordPress to compile the data into an XML file that can be downloaded to your computer and stored. Should the data ever need restoring, you can use Tools > Import > WordPress to manage this process.
Note that some slower servers might experience problems delivering this data expediently, or at all. If this is the case, you will need to consider one of the following solutions.
slide 3 of 6
Back Up the Database Directly with MySQL
By signing into your MySQL server you will have more direct control over the content that is backed up. This is the data at its most raw, so any errors here might cause you quite a few problems.
In order to back up your WordPress blog database, begin by signing into PHP MyAdmin. Next, ensure that the correct database is selected on the left-hand side, and then using the tabs in the main pane select Export. Here, under the Export window, use Select All to prepare the entire contents for export or Unselect All to choose a smaller group of tables to export (which you can do by left-clicking and holding CTRL). Under this section, choose your export format, and then at the foot of the screen confirm that the Save as file box is checked. Choose your compression type (None, Zipped, GZipped) and then click Go to begin the export.
This might take some time, so once you have chosen a download location for the backup you leave it running while performing other tasks.
slide 4 of 6
Database Backup with a Plugin
If you have any problems with the previous fixes (you might be using a low-spec, low-speed shared hosting and be unable to afford dedicated or VPS hosting), then there is a very useful WordPress plugin that you can use to assist. This will also prove useful if you don’t like messing around in the MySQL database in PHP MyAdmin.
You can add this plugin by opening the Plugins section of the WordPress Dashboard, selecting Add New and searching for WordPress Database Backup. Once found, check compatibility and if appropriate, Install this plugin.
Once complete, you can access the plugin via Tools > Backup. Here you can select tables in addition to a standard subset that will always be backed up, and Backup Options include saving to a folder on the server, downloading to your computer or emailing.
A scheduled backup can also be run, although this is limited to being sent via email.
slide 5 of 6
Don’t Forget to FTP the Folders!
In addition to the database, you should also remember to back up your theme folder or any other directories on your server that are regularly updated (perhaps the uploads folder).
You should be able to do this pretty easily via your FTP software. The best option is probably to select the /wp-content/themes directory in order to download a copy of its contents to your computer, and you might perform this task once or twice a week for a busy site, or less often for a smaller blog.
Each of these tasks can be performed in just a few minutes, and provide you with good data resilience in the event of data loss. While many web hosts automatically back up your website, they may not retain more than one copy per week, which might lead to issues. If you have your own backups, you can get things back up and running following and loss of power or data.