Hello again everyone. This is Chris Jean, iThemes’ very own Code Monkey. Today, I’m going to do my best to help you prepare for and plan WordPress upgrades.
When should a person upgrade their WordPress blog? Frankly, this is not an easy question to answer.
The answer is completely dependent upon what type of site you are running, how important it is to ensure maximum uptime for the site, and how skilled you are at fixing problems like a failed WordPress upgrade. Even after determining a safe amount of time to wait before upgrading, there are a number of things that you should do before upgrading.
In this post, I hope that I can not only provide you with a base guideline for when you should upgrade but also how you should upgrade.
WordPress upgrades from an iThemes perspective
As a new WordPress version release approaches, we actively work to ensure that there aren’t any problems with our themes or plugins that would cause them to fail when the new version comes out. Personally, I run the latest development code for weeks on my personal sites and on my development sites to try my best to catch any and all bugs or potential problems.
So far, the 2.8 release has been kind to us. The internals of WordPress really didn’t change, so we didn’t have to update any of our code specifically for the new version release.
However, this isn’t to say that there will not be any problems. Problems always have a way of appearing out of nowhere. As always, if you find a problem with your theme after a new version release, please stop by our support forum and let us help you out with it.
Even though we have yet to find any issues related to our themes with the 2.8 release, some customers have still had issues after the new version release. So far, all of these have been caused either by plugins that have not been maintained or by custom code running on the customer’s site that was not tested on the new version. Please keep in mind that themes aren’t the only source of potential problems as a site’s plugins and customizations can also cause upgrade woes.
So, this brings me to some basic steps that should be followed to give you the best chance at a safe upgrade on your site.
Five things to do before upgrading WordPress
Now that WordPress is so easy to upgrade, you can simply click a button and let the software take care of it for you, it becomes very easy to forget that this process can fail. If the upgrade does fail, your site could be down for hours or days or you could lose valuable data from your site (posts, pages, etc).
Doing the following won’t guarantee that you won’t have problems, but adhering to these recommendations will go a long way toward minimizing the risks of upgrading and will allow you to recover better in case of lost data.
Make a backup of all your site data– Even though WordPress itself tells you to backup your data before upgrading, most people don’t. This is just inviting disaster as most people don’t have any backup strategy and losing any data means that it is lost forever.
The easiest thing to do is go to Tools > Export and save an XML export of your site’s data. This backup isn’t a complete backup, but it does have all your site’s posts, pages, comments, custom fields, categories, and tags. This is the most valuable data on your site, so at the very least, save this export file before doing the upgrade.
To get a more complete backup of your data, I recommend using the WP-DB-Backup plugin. This plugin allows you to create a backup of all your data, including any data that your plugins could have stored on your site.
Upgrade all of your plugins – Most plugin authors work hard to ensure that their plugin will not break your site. When a new WordPress version nears release, they will update their plugin as needed to ensure that it still works and that it won’t break your site. By upgrading your plugins first, you give yourself a better chance of avoiding a problem caused by plugins after the site upgrade.
Visit plugin and theme author websites – Beyond simply updating your plugins, visit your plugin and theme authors’ sites. If the code is still being actively developed, the author should have information about compatibilty with the new release. If there aren’t any updates, contact the author and ask them directly.
When dealing with a plugin, if you can’t get a confirmation from the site or the author, I highly recommend that you disable the plugin before upgrading. You should also see if you can find anyone else running the plugin to see if they have any issues running the plugin on the new version.
If your theme is no longer actively maintained or was a custom-built theme, test out the theme on a test site running the new version of WordPress first before upgrading your live site. I have more information on test sites toward the end of the post.
Disable all plugins – You’ve updated your plugins and ensured that they will work with the new version. Before doing the upgrade, you should disable all plugins to ensure that they will not cause any issues during or after the upgrade.Once the upgrade is complete, reactivate the plugins one at a time. If activating one of the plugins causes the site to break, go and delete that plugin’s folder inside wp-content/plugins. This will force the plugin to disable and should give you access to your site again.
Ask yourself if you need to upgrade now - Getting back to the main topic, you really should consider if you are 1) prepared enough for the upgrade and 2) your site is ready for the upgrade. I’ll talk about this in more depth in the next section.
How important is your site?
Your site is a source of income for you, has very high traffic, or could be severely hurt by any downtime. A new WordPress version just came out. Should you upgrade right now? Frankly, if you can’t accept any amount of downtime, wait a minimum of two weeks after the new version comes out. This will give the WordPress developers enough time to identify and fix any major issues that were found immediately after release. The same goes for giving your plugin and theme developers enough time to ensure that there aren’t any problems.
If your site is just a hobby site or you don’t mind having some downtime, go ahead and update as soon as you are ready. You could end up finding a problem that helps out the community.
To hit the main point again: If you rely on your site and maximum uptime is important to you, wait at least two weeks before upgrading to a new version of WordPress.
Safest choice: run a test site
I’m a huge fan of test sites. I actually have numerous test sites. I have a primary one that I use to test any code that I plan on moving over to my personal website. I have a primary development test site that I use to build and test new code for iThemes. I also have a running version of most of the major versions of WordPress.
This type of solution is overkill for most people, and I really have a hard time recommending it to the average user. However, I do think that every person who runs a WordPress site that needs to have maximum uptime should have at least one test site. What makes a good test site? I’m glad you asked.
The test site should reside on the same server as your live site. This will ensure that differences in core software on the servers won’t create unpredictable results. In other words, it creates a level playing field that makes your testing environment simulate your live site much better.
Ensure that your test site is a duplication of the live site. The data isn’t what is so important here; rather, you need to have the same version of WordPress installed complete with exact copies of the theme and every plugin. The theme and all active plugins on the live site need to be activated on the test site.
If you are concerned about people stumbling onto your test site, simply protect the site with a username and password. You can do this by creating .htaccess and .htpasswd files and then loading them onto your test site. Instructions can be found here.
Once you have your test site up and running, always run any upgrades, new plugin installations, theme modifications, etc through it first. If your test site breaks, breathe a sigh of relief that it isn’t your live site. If your test site keeps running, you have as good of an assurance as you’re going to get that your live site should work just fine after the change.
For those of you that don’t like the massive amount of information I’ve thrown up here and just want quick answers, here’s a summary:
Always backup your site data in Tools > Export before upgrading WordPress.
Always update all of your plugins before upgrading WordPress.
If your site’s operation is critical for your business, reputation, or because you don’t want the hassle, wait at least two weeks after a new version release before upgrading WordPress.
The best way of knowing what will happen to your site after an upgrade is to make a personal test site that has all the same plugins and theme activated and running the upgrade on the test site first.