clubmate.fi

A good[ish] website

Web development blog, loads of UI and JavaScript topics

Automatic backup solutions for WordPress

Filed under: WordPress/PHP— Tagged with: backup, database, ftp

Here’s a guide to different solutions how to automatically backup WordPress database and/or files.

I've never needed my backups, but their something one just needs to have.

See the update notes in the bottom of the post

Backing up only the database with WP-DB-Backup

  • Instal the plugin.
  • Goto: Tools Backup.
  • From the backup options choose email backup.
  • Go and make yourself a new gmail account (or any other free email that is not in your server), called something like backup.xxxxx@gmail.com. Takes two minutes.
  • Now you can just use that to back up your database.

That's so simple! Set it and forget it. When you need the backups, just get them from the mail.

Works like a train and is totally free. But that's only the database, files are important to back up too.

Backup database and files to Amazon S3

If you don't know what S3 is, have a look. Basically it's a very affordable storage provided by Amazon, where you can upload any amount of data, you pay what you use, see pricing. I'm not gonna go through the set up cause it's very straight forward. Though, credit card is needed, can't pay with PayPal in Amazon.

Setting it up is as easy as:

  • Instal the plugin
  • It adds a menu item called Volcanic, click it
  • Paste in your AWS Access Key
  • Paste in your AWS Secret Key
  • Choose / create a bucket (that means folder in S3 world)
  • Choose how often you want to back up
  • That's about it. I find the preset setting to be very good

There has been one problem for me, it only takes daily backups, no matter what I tell it to. Someone else has this issue too, hope it'll be fixed. Otherwise this has worked for me very well. It's not totally free, but it's not expensive.

Backup database and files to Google Drive

This is something new and exiting. Google Drive is basically Googles response to Dropbox. When you install the drive app it creates a folder where you can drop stuff and share. You'll get 5GB for free.

Installing the aptly named plugin, Backup, was not as straight forward as could be.

When I activated the plugin it said:

"Please enable 'allow_url_fopen' in PHP. Backup can not function without it."

This depends on your hosting of course, I'm on Mediatemple (gs). Mediatemple knowledge base article sais following:

"If enabled, allow_url_fopen allows PHP's file functions to retrieve data from remote locations such as an FTP server or web site, and could lead to code injection vulnerabilities."

I have no idea how serious that is . . . It wouldn't be disabled for nothing, right?

Add this to php.ini file to enable it.

allow_url_fopen = On

Editing the file probably differs depending on service provider. Here's how to edit php.ini file in Mediatemple (gs).

Okay, nice, it worked. We're not clear yet. Next alert was this:

"Please load the 'zip' PHP extension. It is needed in order to create the archive to be backed up."

Here's an article how to do that.

Now the plugin is finally running.

Configuring it:

  • You need Google Client ID, get it here
  • You need to add this http://clubmate.fi/cm/wp-admin/options-general.php?page=backup&action=auth as the "Authorize redirect URI" (you need to click the "more settings" button) when you're creating the Client ID
  • Now it shows you the "Client ID" and the "Client secret", paste them in
  • To set the folder paste in the folder ID. To get it, navigate to the folder and copy it from the browsers address bar, it comes after #folder/. First I stupidly used the folder name, as would be logical.

You can trigger a manual backup by navigating to http://example.fi/backup/ (why not just a button?). Note that it does not save that to the Drive, only to your server, where you can then download it by clicking the "Download" button.

The Backup plugin is really great I think, and something I'll be using. For small sites, the 5GB of storage will do just fine for long time. Bigger sites it's quite small. I have one site that is over a 1GB of data to back up. Luckily you can set how many backups to store and the extra space is not that expensive: "25GB for $2.49/month, 100GB for $4.99/month or 1TB for $49.99/month. When you upgrade to a paid account, your Gmail account storage will also expand to 25GB."

I just hope the instal process wouldn't be easier.

Update:

The backup plugin seems to be under a heavy development. It has changed, so that it is possible to save the manual backups to Google Drive also. It's also possible to adjust the amount of local backups and Google Drive backups separately.

Update 2:

The Google Drive Backup plugin has now been completely rebuild, and the installation is much easier. You can skip most of the annoying steps.

Comments would go here, but the commenting system isn’t ready yet, sorry.

  • © 2022 Antti Hiljá
  • About
  • All rights reserved yadda yadda.
  • I can put just about anything here, no one reads the footer anyways.
  • I love u!