My *nix world

Backup your WordPress site

Many of us have a web log where we share with others our thoughts, experiences or ideas. One of those CMS that aids in blog editing is the ubiquitous WordPress. It has a market share of 59% within the Content Management Systems (CMS) market so it's not a surprise that 24% of all existent websites worldwide (no matter if it is an online newspaper, a corporate website or just a weblog) are powered by WordPress.

Background

According to the Internet Live Stats it is expected that the total number of websites to exceed over 1 billion in the late of 2015 where the actual total number of Internet user is somewhere above 3 billion.
That is just impressive!

Obviously this means a lot of content (like text, images, videos) gathered around the WordPress, isn't it?
According to the 2014 report from the HTTP Archive the average size of a page has about 2MB. According to the WorldWideWebSize.com the Internet has over 4.7 billions web pages.
Now do the math: 24% of these 4.7 billions are powered by WordPress and each page has an average of 2MB => 2.4 PB (ie. 2,365,587 GB).

Do you backup your WordPress site? How?

I am wondering how many of these WordPress websites are backed up regularly, let alone how many people do test their backups. Do the WordPress has an internal backup/restore functionality and how it works? Are there any other alternatives?

The Solution - WP MyBackup

pro-banner

If you host your weblog at WordPress.com then your blog is automatically backed up regularly among with all other website hosted by that company. If you need a local copy of your weblog then WordPress provides an option to export your web content as an XML file that is downloaded on your local system.

Furthermore WordPress provides an option for importing that XML file too although depending on your web host the size of the file may be limited (like 15MB or below). You can however exceed these limits by talking with your hosting company or, in case you are the website administrator then you can follow this route.
So basically you end up with this file (which could be 100MB) that later you can re-import on the same place or somewhere else.

Basically these are the default options that WordPress comes with. No full backup (files like attachments, images, videos - the uploads - are not included) or scheduled backup, no compression at all, no storing the backup to cloud, no full restore. Nada. Niente. None.

WordPress is an ecosystem that has the minimal core functionalities built-in. On top of that it has a theme/plugin layer that allows one to install additionally any theme/plugin available out there which allow the customization of WordPress installation as needed.

Regarding the backup and restore there are many plugins available out there but here I will talk especially about a new one that I've created and published these days: WP MyBackup.

WP MyBackup plugin allows one to create a full backup of its WordPress blog including:

  • the WordPress core and admin dashboard files
  • the blog uploaded data (like cache, images, videos, files)
  • the WordPress plugins and themes
  • the WordPress MySQL database which contains all your posts/comments and obviously your WordPress blog settings

The plugin allows you a fine-grained selection of what to include/exclude in your backups. For instance, you may include/exclude certain directories. You may even exclude files by extensions (eg. *.exe) or by name using an exclusion pattern (eg. uploads/videos*.avi). Nonetheless you may specify what MySQL table to include/exclude by using a regular expression pattern (eg. ^(ab|xy)+.*[0-9]$). Wp MyBackup allows you to run some MySQL maintenance (like database optimization/repair) before backing up your data. The resulted backup is a full SQL database script or if you prefer phpMyAdmin then it can create even an phpMyAdmin-like XML file.

So far WP MyBackup allows you to automatically store your backups to various targets like:

Regarding the FTP/SCP/WebDAV or e-mail targets you should know that WP MyBackup provides an extended set of advanced features for them like the transport library to use (which can be PHP built-in or the powerful cURL library), the mail back-end (like SMTP, sendmail or the built-in PHP mail function), email attachment size, SMTP connection parameters, etc.

Coming soon
In the nearest future it is planed to extend these backup targets with few more like Rackspace cloud, S3 services (like Amazon, HostEurope, etc), Microsoft Azure and Microsoft OneDrive, Amazon Glacier, DreamObjects, OpenStack, Copy.com and others.

WP MyBackup allows you even to schedule the date/time the backups are automatically created and also their recurrence (like daily, weekly, etc). This is a nice feature because you just set it once then never bother again. A worry-free backup - you might just like!

To help you optimize the space usage WP MyBackup allows you to choose the type of compression like (TAR, GZ, BZ2) and the compression level (10 different levels available where 0=none and 9=best). If for some reason your archive should have a fixed size (like 150MB) then you should know that WP MyBackup supports multi-volume archives. Whenever your backup ends (with success or failure) you will be notified by email which includes the full log of the backup job.

Now, being a developer for a while (like 20+ yrs) I know that there is no bug-free program. One reason for that is obviously the huge spectrum of environments that the end-users have/use and which cannot be tested in our limited testing environment. Let alone the interaction between our program with some other programs on the end-users environment which we never heard of. Nevertheless sometimes the problems that the end-users meet have nothing to do with the product itself (the product just happen to be a victim as well as many other programs in that environment).

To handle the potential situations described above WP MyBackup comes with a powerful logging mechanism that collects and to store different events together with their execution arguments and responses:

WP MyBackup also includes an option that allows you to check your PHP setup (is your environment ready for this plugin?). It will give you a complete table of system information including:

  • the PHP, web server and OS version
  • the OS total/free resources
  • the installed PHP extensions and their version
  • the installed/active WordPress plugins and their version

All this information gives the end-user (or the support team) enough debugging info to trace an issue and to find a solution.

The plugin is obviously free (like any other plugin hosted by WordPress.org), its source code was made public (under the terms of GPLv3) and can be downloaded/forked from plugins.svn.wordpress.org/wp-mybackup.

An enhanced version of this plugin is also available (WP MyBackup - PRO). The main difference between the free version and the PRO version is that the PRO version allows additional add-ons to be installed on top of those functionalities provided by the free version. There are over 20 different add-ons available as of September 2015. Below are few of the key features that may be used with the PRO Version:

Furthermore the PRO version allows you to get Premium Support.

You may also want to read these:

A non-WordPress implementation of this product is called simply MyBackup PRO and has also a free edition that was made public and can be downloaded/forked from its GitHub repository: https://github.com/eugenmihailescu/my-backup.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
Backup your WordPress site

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Backup your WordPress site

Latest posts by Eugen Mihailescu (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *