Creating and implementing a backup strategy is one of the first things you should do when creating a new site. A backup is your insurance plan against the many types of human and technical errors that will bring down your site. If you don't know anything about backing up your Builder Beaver site, don't worry, we got you covered. In this post, we are going to cover the different backup methods, what to backup, how often you should backup, and where you should store the backups.
Reasons to Backup Your Site
Before we talk about creating a successful backup plan, we should talk about why you should create a backup.
- Hack Recovery: If your site gets hacked, you can restore your site to a clean version of the website.
- Roll Back Broken Update: Unfortunately, updates can occasionally create conflicts or even break your site. Having a recent backup allows you to roll back the update and get your site back online.
- Accidental Deletion: We are human, and as humans, we can make mistakes. I once accidentally deleted a large portion of my database and destroyed multiple sites with a single mistake. Luckily for me, I had a backup, and my sites were back online in a couple of minutes.
- Data Corruption: Your server timing out during a WordPress update can cause data corruption, which will break your site. If you have a backup, it is an easy fix.
The Real Cost of Lost Data
Uh oh, your e-commerce plugin had a fatal error when writing to the database. Now all that anyone can see on your website is the Error Establishing a Database Connection warning. And because disaster only strikes at the worst possible time, you are in the middle of a huge sale.
- Record of Sales: Every purchase on your site is recorded in the database. If your database is corrupted, you have lost your sales history and customer information.
- Customer Trust: When your customers don't receive their purchase or lose membership access, you will lose their trust. Acquiring customers is hard enough, and you should do everything you can to keep them.
Our friends at iThemes built a handy calculator to help you determine the replacement cost of your content.
Creating a Backup Strategy in 6 Steps
A good strategy includes your backup method, the backup content, the backup frequency, the backup schedule, storage location, and checking the backups for malware.
Creating a backup strategy will give you peace of mind knowing that you are prepared if disaster strikes.
Step 1. Choose a Backup Method
There are three common methods of creating a WordPress backup, host created, manually created, and plugin created. In this next section, we are going to cover the pros and cons of each method to help you choose the one that best meets your needs.
A: Host Backups
Many hosts will include a backup feature with your hosting plan. The backups are typically automated, and the hosts will usually handle restoring the site for you. Having your host take care of the backups is excellent for people who are intimidated by anything technical.
However, backups made through your host are frequently unreliable and difficult to access. Not to mention you will have to wait on hosting support to restore the site, which could mean hours of downtime. Another limitation of hosts backups is that they can't be used to migrate your site to a new host. If you are having problems with your host, you need to have the ability to move hosts.
- Can be included in with your hosting plan
- Can be unreliable and difficult to access
- Reliance on hosting support can lead to increased downtime
- Backups can't be used for migration
- Often limited to a single daily or weekly backup
B: Manual Backups
Manual backup's most significant advantage is that they are free. However, they require a highly technical WordPress user. You can manually backup your site's files using an FTP client like FileZilla and backup your database using a tool like phpMyAdmin. For more detailed instructions, check out the WordPress.org support article on WordPress backups. Keep in mind, using manual backups will require you to restore your site manually.
- Control over the backup process
- More technical knowledge required to Restore and Migrate
- More time consuming than other backup methods
- Forgetting to create a backup
C: WordPress Backup Plugins
Using a plugin to create a backup will be the method that is the best of most people. Unlike host backups, backups created by a plugin can be used to restore and migrate your website. Plugins will typically provide more options to fine-tune when your site is backed up, what is backed up, and where that backup is stored. Another advantage is that you will not have to wait on your host's support to restore your site, which can lead to less downtime.
- More granular control of backups
- Backups can be used to restore and migrate
- Easy to use and configure
- Typically requires a subscription
Step 2. Decide What to Backup
To know what to backup, you need to understand how a WordPress site is structured and where everything is stored.
Overview of The Anatomy of a WordPress Site
The WordPress install directory–sometimes referred to as the site's root directory–contains all of the site's files.
A. Inside the WordPress Directory
- The wp-admin and wp-includes directories contain the files needed to make WordPress go. To log into your site, you must navigate to yoursite.com/wp-login.php. When you enter the login URL into the browser, you are requesting to see the wp-login.php file which is stored inside your site's wp-admin folder. The .htaccess files–which is typically hidden by default–will contain various server rules. The wp-config.php file stores site-specific information, including the credentials needed to access the database.
I like to think of the wp-content directory as the site's personality. The directory stores everything that makes the site unique to you.
B. Inside the wp-content Directory
- The plugins directory stores all of the plugins installed on the site.
- The themes directory stores all of the themes installed on the site.
- The uploads directory stores the media library and various other files uploaded to the site.
If the wp-content directory is the site's personality, the database is the site's brain.
C. Inside the WordPress Database
- The WordPress database stores the posts, pages, comments, options, user data, purchase history, and a whole lot more.
Now that you know where everything is stored, you can make an educated decision of what, and how often to backup.
Step 3. Choose the Backup Frequency
When deciding how regularly to backup your site there are three questions you should ask yourself.
- How often does the content change on your site?
- How often do users interact with the site?
- How much tolerance do you have lost data?
If you publish a new post once a week, a weekly backup will be enough to prevent data loss. However, if you have an e-commerce site, an hourly database backup will be better to avoid losing purchase data.
A good rule of thumb is that you should be backing you your site often enough to keep up with changes to your website.
Step 4. Create a Backup Schedule
Now that you know what backup method you are going to use, what you need to backup, and how often, it is time to create your schedule.
Using a plugin like BackupBuddy, you can create and automate your backup schedule.
The example above is a perfect database backup schedule for an e-commerce site; every hour, a backup of the database will be created. You can make things even easier using something like Stash Live to automatically backup any changes made on the site. Stash Live ensure you will always have an up to date copy of your site stored safely on an offsite location.
Step 5. Choose an Offsite Location to Store Backup
Backups need to be stored securely offsite, in a different location than the server running your site. An essential component of a backup strategy is offsite storage of your backup files. Storing backups on the same server as your site can leave them inaccessible in the case of several failures. If your server gets hacked, a backup stored on the server has a high chance of being compromised.
Step 6. Scan Backups for Malware
A backup plan is only as good as your backup. Scanning your backups for malware can help you catch infected backups before using one to restore or migrate a site. If you are trying to recover from a hack using a backup infected with malware will not help. Using an infected backup will only extend the time it takes to clean your site.
Bonus: Practice Restoring Your Backup
If you are needing a backup to restore your site, the chances are trying to recover from a disaster. Being confident in your ability to restore the site will make it easier to recover your site under duress. Having a backup will only help if you know how to use it.
Having a backup is your insurance against disaster. When creating your backup strategy remember to consider these 6 steps.
- Step 1. Choose a Backup Method
- Step 2. Decide What to Backup
- Step 3. Choose the Backup Frequency
- Step 4. Create a Backup Schedule
- Step 5. Choose an Offsite Location to Store Backup
- Step 6. Scan Backups for Malware