How to Make Automatic Backups of a WordPress Site

 

Click here to skip to the step-by-step instructions below.

You probably already know why it’s important to back up your WordPress site – lots of things could go wrong:  hackers could break and in and mess everything up, the database could become corrupt and you lose all your content, your server could crash, you could install a plugin or theme that breaks things, rabid robots could attack… well, maybe not the last one.

But lots of stuff could go wrong and if it does you could lose lots of precious data like the blog posts and pages you spent hours writing and everything you’ve customized on your site.

It’s possible to make manual backups of your site, but who wants to do that?

Why do it over and over again when you could instead just set it up once and have it done automatically?

Setting up automatic backups for your WordPress site is smart because, for one, if you depend on doing it manually it probably won’t happen.  You’ll forget and a year will go by with no backups.  Then when someone hacks into your site you’ll be like, “Oh yeah, I was supposed to be making backups.”

With automatic backups you can sleep easier knowing your site is safe.

The easiest way to set up automatic backups is by using a plugin.  There are different options out there – some free, some paid.

One popular paid plugin I’ve used is called Backup Buddy.  It’s a nice plugin and has some nice features.  One specific case where I’d recommend Backup Buddy is if you need to migrate a site from one location to another, especially if you’re changing the domain in the process.

The other advantage of Backup Buddy is that setting up off-site backups is much easier.  By off-site, I mean that your backups are stored somewhere other than on the server where your site is hosted.  I strongly recommend doing off-site backups.  You can do them with free plugins, but it involves having an account somewhere to set up.  Backup Buddy includes storage with their service called Stash.  So there’s nothing separate to set up really.

However, there are free plugins that work perfectly for doing regular backups of your site and doing off-site storage.

The free plugin I use most often is BackWPup.

I’ll walk you through how to set this up, step-by-step.

1. Install the Plugin

The first step is to install the plugin.  This plugin installs the same way you’d install any other plugin so I won’t go into detail here.  The simplest way is to log into your WordPress site and go to

Plugins -> Add New

In the search box type in “backwpup”

The BackWPup plugin should be the first one listed.  You can click the Install link to install it.

Once it’s installed, click Activate for the plugin.

2. Configure the Plugin

After installing the plugin you should now have a menu item on the left called “BackWPup”.  Click that.

When the plugin is installed or upgraded it does something annoying where you have to look at a sales message trying to get you to upgrade to the paid version.  You can just scroll down to the bottom and click the button to start using the free plugin.

Now you should have a menu item called “Add New Job” under BackWPup, or it may be on the screen you’re on too.  Click that.

You should now see a row of tabs:  General, Schedule, DB Backup, Files, Plugins.  We’ll look at these tabs one at a time.  I’ll give you my recommendations for settings but if your needs are different you may want to use different settings.

General

Job Name:  You can enter whatever you want here.  You’ll probably only have one backup “job” so it’s not likely you’ll get it mixed up with any others, so call it what you want.  For example, “My backup so I can sleep well at night” or “Weekly Backup”.

Job Tasks:  Put checks in these boxes: Database backup, file backup, installed plugin list

Backup File Creation:  I would just leave the Archive Name part alone – the default setting is fine. For the Archive Format, I’ve had success using Tar or Tar GZip.  This has to do with the file format of the backup file.

Side Note: As a Windows user, you might think you’d want to use Zip since it’s more familiar and you can open the file on your computer.  However, in the tests I’ve done, sometimes Zip format has issues where it takes a long time to back up and ends up timing out and not finishing.  There is a free program called 7-Zip you can use to “unzip” or decompress these file formats.  

Why would you need to open the backup files?  If anything goes wrong and you need to restore your site from a backup, you’ll need a way to work with the files, or you might want to get something specific out of a backup.  For example, if you upgrade a plugin to the latest version and it causes problems on your site you may want to go back to the version you had installed previously.  If you have a backup, you can extract the old version of the plugin.

Job Destination

This part is very important and you’ll need to make a decision about which option to use.  I’ll explain the different options so you can make a decision about it.

  • Backup to folder:  This means the backup file will be stored in a folder on your hosting company’s server, where your website is hosted.  There are pros and cons to going this route.  The main benefit is that you don’t have to set up any accounts anywhere else so it’s quicker and easier to set up.But there are some serious downsides to this approach.  First, since the backup is on the same server as your website, if something happens to your server like if it gets hacked or if it crashes, you’ll lose your site and your backups, so the backups won’t do you any good.  Sure, you can log in and download the files, and that’s fine as long as you remember to do it.  But I prefer a more automatic solution where everything is automatic and I don’t need to worry anything unless I need to do something with the backup.Second, the backups can take up a lot of space.  If you’re not careful when setting it up, when the backups run, it will back up your previous backup files, which means your backup files can get really big quickly.  For example, let’s say you run your first backup and it’s 50MB.  The next time it runs, it backs up your site which is still 50MB, but also the previous backup file, so this backup file is 100MB.  Next time it runs, you have your 50MB site plus the 50MB backup plus the 100MB backup so now your backup file is 200MB.  The next time it’s 400MB.  As you can see, it ends up doubling in size every time, which can quickly eat up your disc space on your server.  This is avoidable, but you have to put your backups in a certain folder and in the settings tell backWPup not to back up that folder.For a long-term solution I wouldn’t recommend the Backup to folder option, but if you don’t have any backups of your site yet, this is a good short-term solution so you can at least have a backup.  You can run the backup and download it to your computer so you have a copy of your site.
  • Backup sent by e-mail: This means that when the backup is made, it will be e-mailed to you as an attachment.  This option might sound nice, but e-mail accounts have limits on the size of attachments, so unless your site is really tiny and doesn’t have many photos this probably isn’t a good option.  Also, sometimes e-mails with zip files attached can be suspected as being Spam or the attachment might be suspected as being a virus and removed from the message.  All around, I haven’t found this to be a good option.
  • Backup to FTP:  FTP is a way to transfer your backups to another hosting account.  So if you have another hosting account somewhere, this could be an option.  This could be fine as long as it’s on a different server.  I wouldn’t necessarily set up a separate hosting account just to use this, but if you already have one it could be OK.  You may want to check to make sure the hosting account doesn’t have any issues with you using their service for file storage.  Some do, especially low cost ones.
  • Backup to Dropbox:  Dropbox is an online file storage service that be used for a variety of things.  You can share files between multiple computers or even mobile devices.  For example, I use Dropbox on my laptop and my iPhone because it’s an easy way to put files like PDF files and Word documents on my phone without having to connect my phone to my computer.  It also automatically uploads photos from my phone to my laptop.  You can also use Dropbox to share files with friends.  For example, I have a folder on my computer where I can put files I want to share with a friend of mine and when I put the files there, they are automatically added to his computer.So maybe you already use Dropbox.  If so, this might be a good option for you.  Just make sure your account has enough space.  They have a free level which, as of this writing, is 2GB.  Chances are, that’s plenty for backing up your site.  Most are not that big.  But if you use if you use it for lots of other things, you may not have enough room.You can upgrade to a paid account if needed, which starts at $9.99.Overall, this is a good option.  It seems like certain plugins can interfere with backing up to Dropbox, but generally this can be a good choice.
  • Backup to an S3 Service:  This is the option I use most often for my own sites.  This refers to online storage services, sometimes called cloud storage.  Some examples are Amazon S3 and Google Cloud Storage.  Personally, I use Amazon S3 but Google Storage is a great option too.  Both have a free level so that if you don’t need to store too much (currently 5GB or under), you don’t have to pay.With these services your files are stored online and if you ever need to access them you just log in and download them to your computer.
  • Backup to SugarSync:  SugarSync is similar to DropBox mentioned above.  It’s for online file storage, syncing and sharing.  They have a free level that (as of this writing) gives you 5GB.  I haven’t personally used it but this should be a good option.

Log Files

I usually just leave the default settings here.  But if you want it to go to a different e-mail address you can change that.

Check the e-mail address in the “E-mail FROM field”.  The first part you can leave alone (the BackWPup part), but the actual e-mail address within brackets you may want to change.  If the e-mail address listed there is hosted on this server then you’re OK.  If not, it would be a good idea to change that.  Why?

Well, let’s say it has your Gmail address listed as the From address.  Your server isn’t authorized to send e-mails from a Gmail address.  When the e-mail is sent, the e-mail address that receives the message checks to see if it really came from Gmail.  It didn’t, so guess where it goes?  That’s right, your Spam/Junk mail folder, meaning you’ll probably never see it.

How can you avoid this?  One way I’ve found that works is to have the “From” address be something @ my domain, even if it’s not a real e-mail address.  For example, let’s say my site is mysite.com.  I might set the From e-mail address to be no-reply@mysite.com.

I won’t be replying to these messages so it doesn’t matter that it’s not a real address.  If you have trouble with the messages still going to Spam you might need to actually set up an e-mail address on that domain.

The default setting is to only send you an e-mail if there are errors, meaning if everything is going well with your backups, you don’t receive an e-mail.  While that’s the case, it’s still a good idea to check in once in a while to make sure everything is going OK, just in case you don’t get the e-mails or the plugin is broken or something.  But normally with this setting no news is good news. 🙂

Now you’re ready to click… Save Changes!

But don’t get your hopes up, you’re not done yet! 🙂

 

Schedule

Now you need to click the Schedule tab.

This is where you can make the backups automatic.  The setting I use is “WordPress cron“.  The other options are for running the backups manually.

Now scroll down to:

Schedule execution time

This is where you tell it when you want the backups to run.  You can probably leave it set to “basic” for the Scheduler type.

Under Scheduler, the first column is for Type.  Do you want the backup to run monthly?  If so, check monthly and choose what day of the month you want the backup to run.

If you update your site more frequently than once a month, or if you have people making comments on a regular basis you may want to make backups more frequently.  For example, you might choose to do a weekly backup.  If so, choose the day of the week when you want the backup to run, as well as the hour.

Running a backup takes a fair amount of memory so it’s best to run backups when there won’t be so many people using your site, otherwise things could slow down.  If you’re not sure when most people are using your site, probably a good rule of thumb would be to run the backups late at night on the weekend.  For example, you could choose to run the backups on Sunday at 3AM because for most sites that’s not likely to be a busy time.  But if you know that’s a busy time for your site, you can choose a different time.  As you’d probably guess, the hours are military time, so if you want 11PM you’d choose 23 for the hour.

If your site is updated really often or has a lot of activity you may want to do daily or even hourly backups.  For most sites that’s probably overkill, but if you know that’s what you need, go for it.

Once you have these settings, click Save Changes.

Now click the next tab:

DB Backup

This is where you back up the WordPress database.  This is really important because WordPress stores everything in a database.  All of your posts, pages, settings and other content are stored in the database, so you definitely need to back it up.

Most likely you want all of the tables to be backed up so, if they’re not already checked, click the All button next to “Tables to backup” and that should check all of them.

You probably don’t need to change anything else, so click Save Changes.

Click the next tab:

Files

In the last section we backed up the database, which holds all the text for all your pages and posts, along with settings and other data.  The other main part of your site is the files, which includes the WordPress files, your theme, your plugins, all the photos you’ve uploaded, and any other files you’ve uploaded through WordPress.

It’s possible that you have other files on your site that are not connected to WordPress, such as static web pages that were not created in WordPress, media files, etc.  BackWPup can back up those files too if you want.  This is a nice option because you can back up everything in one shot.  But if there are tons of files or really large files, it can slow things down.  If you do everything on your site through WordPress then if if you get the WordPress folders you should have everything you need.

Backup root folder:

If you check this box, it will back up the root of your site.  In most cases I would check this box to back up everything.

You’ll see a list of folder names with check boxes next to them.  Take note that above this list is the word “Exclude”.  So checking any of those boxes means you’ll exclude them from the backup.  This can be a little confusing because the checkbox at the top means to include the main folder and everything in it, but the individual boxes under it mean you don’t want that item to be included.

If you do everything on your site through WordPress and nothing gets uploaded manually outside of WordPress, most likely you’ll want the “root” folder to be checked (it will likely end in “/public_html” or “www” or something like that), and everything under it to be unchecked.

Backup content folder

You’ll want to have this folder checked.  Normally there’s no need to exclude any of the individual folders.  However, on sites where I have a caching plugin installed like WP Super Cache or W3 Total Cache, etc., I will exclude the cache folder.

Backup plugins

Personally, I like to back up my plugins folder so I put a check in this box.  One reason is that if I upgrade my plugins and the upgrade causes problems on my site, I need to go back to the old version.  I can do that by accessing my backup and restoring the old version.  Also, occasionally I’ll have a plugin that I customize to work a little differently than the way it comes and I shouldn’t upgrade them because I’ll lose my customizations.  If I forget and accidentally upgrade them, I need to get the old version back.

Also, if something happens to your site and you have to restore it from a backup, you probably don’t want to have to manually download and install all the plugins over again.  It’s easier if they’re all included in the backup.

So I check the box to back up the plugins folder and the only specific plugin in the list that I put a checkmark to exclude is “backwpup”.  Why?  Because if you use the “Folder” backup method your backup files are stored inside the backwpup folder.  This will prevent making backups of backups and ending up with really huge backup files.

Backup themes

I check the box to back up my themes.  Often I’ve customized my themes and don’t want to lose my customizations.  Plus I want to make sure if I have to restore my site that it’s the same version of the theme.

So I would check the box to back up the themes and if there are any other themes installed that you’re not using you could exclude them if you want.

Backup uploads folder:

This is important to back up.  Any photos or other media you’ve uploaded are located here.  Make sure this box is checked and normally there’s no need to exclude any of the folders under it.

Extra folders to backup:

This usually doesn’t apply so normally you can just leave this blank.

Exclude from backup: 

I leave everything alone in this section, unchecked and blank.

Special option:

I check the box for “Include special files”.

Click Save Changes.

I usually don’t change anything on the Plugins tab.  This just saves a text file with a list of the plugins you have installed.  It allows you to change the file name and compression setting, but I just leave the default setting.  I not only have a list of plugins but also the plugin files themselves.  It’s not completely necessary to have both, but I like to have both just in case.

 

Step 3: Configure whichever backup destination you’re using

On the first page of settings I went over the different places where you can send your backups.  For example, “Backup to folder”, “Backup to S3 service”, “Backup to Dropbox”, etc.

There should be a tab on the far right on the list of tabs where you can configure whichever one of the options you selected.

I’m not going to go into detail about configuring this last section because it’s going to vary a lot depending on which option you’re using.  Plus if you’re using an external service like Amazon S3, Dropbox, etc. it’s going to require setting up an account (if you don’t already have one) and getting certain details from your account.  The specific steps and where you find that information could change.  So I’ll leave you on your own for this last page of settings.

This last page of settings is essential, though, so don’t think you can skip it.  Without setting it up, your backup won’t have anywhere to go so it won’t happen.

 

Once you’ve completed this last page and clicked Save Changes, it’s time for:

Step 4: Test your backup

It’s a good idea to do a test run to make sure all your settings are right and that your backup is able to run.

On the left menu in WordPress, under BackWPup go to “Jobs”.

You should see the “job” you created listed here, with whatever name you gave it.  If you put your cursor over the name of the job you should see a few links under it:  Edit, Copy, Delete, Run now.

I’ll give you three guesses at which one you need to click.  🙂

In case you weren’t sure, click Run now.

That will start running your backup.  Depending on how many files you have and how big the files are, etc. this could take anywhere from less than a minute to half an hour or more.  If you have a site with just a handful of pages and posts and not too many pictures, you’re probably looking at a minute or two.

When it’s finished, you should see a message telling you if the backup was successful or if it had any errors.

Well, that’s all for this tutorial.  I hope you were able to successfully make a backup of your site and that it’s now set up for automatic backups so you don’t have to worry about it.

Even if you have the backups set to run automatically, I would suggest checking in periodically to make sure everything is working properly.  Log in and make sure the backups have been running successfully.  Also, go to wherever your backups are being sent (for example, log in to Amazon S3) and look to see if you see the backup files there.  You might even want to periodically download them and open them to make sure everything looks right and nothing important is missing.

Congratulations on setting up your backups!

 

, ,

No comments yet.

Leave a Reply

website statistics