31 Oct How to: Backup Your Site
Note: this tutorial is assuming your entire site will be (if it has already, this will be of no help, except for future occurrences) hacked, crashed and wiped entirely. We’ll be walking through, first backing your site up and then restoring it from nothing.
I get this question all the time: how do I backup my site? Should I pay $15/mo to have my hosting company do it for me? What do I do with the files? How do I restore my site? Why would my site crash? And so on.
Rightfully so, I suppose. Before we begin, let me say this: I’ve never had someone who has actually had a site crash with all their data and had everything wiped to the point where they need a full restore. Better safe than sorry, I suppose. What should also be noted is that if you back up your site too often (ie daily or hourly) it can cause a massive burden on your server. To the point where your site is actually loading slower just because it’s constantly being backed up.
For most small businesses, backing your site up once a month should be sufficient. Hell, I back my site up once a year. That’s not to say the content on it is changing, it’s just to say that after the original content, it doesn’t change that often or substantially to require further backups. Additionally, should something go wrong it would take less than an hour or two to get the site back up and running to it’s current state. I feel this is true for most small businesses (especially those without blogs) and the additional space required on the server isn’t worth it.
The first thing we’ll have to do is download a plugin to backup both our database and our files. I’ll be working with a plugin called: BackUpWordPress. You can either download it via that link, or do a search under Plugins > Add New for “BackUpWordPress” and it’s the first option.
Once the plugin is installed you’ll find the options for backing up under Tools > Backup. You can see the size of your database and manage the options for how often everything is backed up. I just run the manual ones, however you may want to run monthly or even weekly backups. You can also set how many backups are stored. All of this can be changed by clicking settings, or “+ add schedule.”
The difference between the database and the files is quite simple: the database manages how your files are used. First, you need the files to have all the content and foundation. Once that is there, your database backup will allow those files to interact with each other and display the proper content.
Note: your posts and pages are actually entries in the database, NOT physical files.
After you schedule your backup, or manually back everything up, you have to download a .zip file. You can see it can be quite large: it literally has the entire WordPress file system within it, as well as all your uploads, themes, etc. Lets take a look at restoring your site, should it completely crash.
Note: individual articles for each of these steps coming later.
- Unzip the downloaded file.
- Upload your files to the root directory (folder).
- Add a database with the credentials in your wp-config.php file. If you can’t use those exact credentials, change the wp-config.php to match the database.
- Import the .sql file found in the unzipped folder
That’s a lot to handle to get everything back up and running. The thing to know, though, is that you can do it. Even if it takes a little bit of time, you have all the necessary pieces.
Questions/comments/concerns? Drop a line in the comments below!