Strategies for Successful WordPress Upgrades

As WordPress has become more and more popular, the community around it has begun to thrive. Currently, we’re seeing a boom in theme development, plugin development, and general use of the platform that’s never existed before. For the most part, all of this is really good stuff, right? Of course!

But there’s one glaring disadvantage to having an ecosystem like WordPress: Upgrades.

At some point, we’ve all experienced an upgrade failure either with a plugin, a theme, or with WordPress core. In some cases, it’s minor – such as with plugins. Simply uninstall, reinstall, and you’re good to go; however, having a core WordPress upgrade failure can bring your site to its knees.

Although problems will continue to happen from time to time, there are significant measures that we can take to minimize potential points of failure.

Research The Upgrades

This sounds like a no-brainer, doesn’t it? Surprisingly, many users see the upgrade notices for a part of their installation in the WordPress dashboard and often automatically upgrade. In some cases, this won’t cause any problems, but it’s always a good practice to research the details of the update

  • Plugins. If you’re upgrading a plugin, be sure to check out the plugin’s change log. This can usually be found on the project’s homepage (or sometimes developers will even display it in the dashboard!). Be sure to take note of any notes about version compatibility. Specifically, if the plugin claims that it’s no longer compatible with the same version of WordPress that you’re running, then avoid installing it.
  • Themes can be deployed in a variety of ways. Some will give notices in the WordPress dashboard, others will publish notes on their website, their blog, or via Twitter. In whatever case, be sure to review the release notes for each update especially concerning version compatibility and any mentions of specific plugins.
  • WordPress. Upgrading the core application is always exciting especially when it comes to checking out the new improvements but upgrading the core can be dangerous because everything else that your blog uses is built onto of it. This means a single upgrade can break both themes and plugins. In the worst case, you may be left without a functioning installation. Always be sure to review the Upgrade Guide in the Codex and the most recent versions changelog.

Of course, these are just general guidelines to follow when preparing to upgrade. Let’s take a look at some more practical tips for safer upgrades.

Testing The Waters

The absolute safest way to go about testing an upgrade of WordPress is to mirror your website on your local machine. This can be achieved by using tools such as XAMPP if you’re on Windows or Linux or MAMP if you’re on OS X. These packages are beyond the scope of this post, but the general setup is as follows:

  1. Export your WordPress content from your web server to your local machine
  2. Create a Local Database to house the WordPress installation
  3. Install WordPress
  4. Import the data into your local installation
  5. Grab your themes and plugins via FTP (or by installing them in the WordPress admin)

At this point, you’ve essentially mirrored your live installation on your local machine. This makes it incredibly easy (and safe!) to perform any updates and changes without affecting your site. It also allows you to detail anything that goes wrong so that you don’t make the same mistake on your site.

A Plan of Action

Before you begin upgrading all of the different components that you have installed, it’s a good idea to come up with the plan of action. It also helps to think of WordPress as a stack. For example, consider your blog as three tiers: the base being WordPress, the middle layer being your theme, and the top level being your plugins.

If you end up upgrading the foundation and ignoring the top two layers, you essentially render the stack useless. Make sense? As such, it’s always a good idea to start at the top of the stack and work down. I’m a fan of upgrading plugins one-by-one, testing the site, then moving to the theme. From them, I repeat the process then I upgrade WordPress itself.

This isn’t the way to perform an upgrade – just a suggested way to go about it. The point is that you come up with a plan that you perform only our local installation and, once it works, you repeat it step-by-step on your live installation.

Perform The Upgrade

At this point, you’ve got a local installation and simulated upgrade that works. You should be ready to perform the update on your live website. Before doing so, there are two additional steps that I always recommend doing first:

Backup Your Database

Despite the fact that you’ve got a successful plan of action, something can still go wrong. Above all else, you want to make sure your data is safe. To that end, be sure to backup your WordPress database. Depending on your experience level, there are a number of options for doing this, too.

  • phpMyAdmin is an application available on most hosting providers. It’s a powerful database front end that makes exporting an existing database very easy. After logging in, you simply select your database and then click on the “Export” tab.
  • mysqldump is another alternative that’s easy to use permitting you’re comfortable using SSH. Once you’ve connected to your server, you can execute a simple command that will dump the database to a small file after which you can transfer it to another server or download it via FTP.
  • Shell scripts are simple, pre-written scripts that can automate the backing up of an entire WordPress installation. Once it has been installed on your server, you can execute it from the command line via SSH. Some scripts will even allow you to trigger them by loading them in your web browser. We’ve covered a freely available script here on Theme.fm in a previous post, too.

Regardless of what utility you use, keep a copy of the data on your local machine in the event that you need to do a database restore.

Launch

Maintenance Mode. Though this isn’t a requirement, Maintenance Mode is a nice plugin that allows you to temporarily throw up a page for your visitors letting them know that you’re currently working on your site.

Maintenance Mode in WordPress

This prevents any of your visitors from seeing weirdness that may occur during the upgrade and also allows you to display a clean landing page should anything go wrong.

From here, you should be good to go. Above all else, stick to the plan that you came up with on your local installation and take your time. There’s no sense in rushing through an upgrade at the risk of compromising your data.

Conclusion

For the most part, setting up and maintaining a WordPress installation isn’t terribly difficult but if you’re managing a large site or a number of sites, then you’ve got more at risk than the average blogger. As such, it’s always a good idea to have a good plan in place for performing necessary upgrades.

Of course, these aren’t the only tips that exist. Feel free to share yours in the comments! For more advanced users we recommend taking a look at Capistrano, originally used for deploying Ruby on Rails applications but also be used in the context of other applications. We’ve covered some examples of how to use Capistrano with WordPress, as well. Definitely worth a look if you’re interested in learning a new tool.

Thank you so much for reading and hope you enjoyed it! Subscribe to our RSS feed for more WordPress tips and tricks.