During December 2010 and January 2011, WordPress released four upgrades to the core, which is quite a lot. I’ve had issues in the past with both core and plugin upgrades, but all have eventually been rectified. Thankfully, it seems as though I’ve finally learnt my lesson(s). So with the impending release of WordPress 3.1 any day now, I thought I’d share with you some tips on how to upgrade the core theme and plugins and give yourself the best chance of avoiding the same problems I ran into.
The post is divided into two sections – Errors upgrading plugins and errors upgrading the WordPress core. I’ll first list the symptoms of each potential error, and then suggest workarounds and fixes. Good luck in finding yours!
Errors upgrading plugins
Upgrade says ‘Downloading update from ‘url’ but actually hangs
You’ve hit upgrade on your plugin and it looks like it’s about to start downloading but doesn’t seem to get any further. This normally happens because the plugin is clashing with another active plugin.
Deactivate all active plugins. Since WordPress version 2.7, they’ve included a helpful “Recently active” table, so you don’t need to worry about remembering which plugins you had active. Once you’ve deactivated them, go back and upgrade your plugin(s). Then go to the recently active plugins link and re-activate them again.
N.B – When a plugin has been inactive for more than 7 days it gets moved to the inactvie plugins table so be sure to sort your upgrades before then or you’ll have to check manually for the plugins you want to be active.
Errors upgrading WordPress core
Unavailable for maintenance
This normally occurs when you accidentally break the upgrade cycle mid-process. So if you click away from the upgrade page while it’s still processsing, any page you subsequently click on will come up blank with this message (including admin pages) and you’ll be caught in an unbreakable cycle. What could be more fun.
First, calm down – it’s an easy fix ;)
The only way to break this loop is to log in to your FTP account and hunt down a .maintenance file located at the root of the install. Delete him and you’ll be able to start the upgrade process again. The file will be hidden so you’ll have to enable hidden files to see it.
Upgrade starts but does not complete
Similar to the plugin upgrade error above, WordPress attempts to upgrade and says downloading from such and such, but never completes.
One common explanation for this is surplus temporary files from previous plugin/core upgrades interfering with the current upgrade process.
Log into your FTP server again and look in your wp-content folder for files such as wordpress-3.tmp. You can safely delete these as they are the result of previous failed upgrades. Go back to your admin and be sure to temporarily deactivate all active plugins before you do your core upgrade again. It should fizz through with no problems this time.
Similarly to the above, WordPress also creates temporary upgrade folders. If you’ve removed your .tmp files and are still having problems, try removing the upgrade folder inside the wp-content folder.
N.B – removing the .tmp files and upgrade folder should be safe enough providing you are not doing so in the middle of an active update, but just to be sure, it’s always good to back up/copy any files you delete to somewhere safer first.
If you’re really unsure or worried about doing these upgrades, you can try installing the Advanced Automatic Upgrades plugin which will help you along the process and offer some helpful tips at the same time. However, as long as you remember the following points, you shouldn’t need too much help if/when you run into upgrade issues:
- Backup your database and files before all major updates
- Deactivate all active plugins
- Only install reputable plugins from reputable sources
- Check for leftover .tmp files on your server and delete them
- Check for leftover Upgrade folder on your server and delete it
- Check for .maintenance file (hidden) on your server and delete it
Running into upgrade problems is thoroughly annoying and can be quite alarming when working on client sites if the sites stop functioning and throw up big error messages. But we have to remember that these upgrades are there for a reason. They come with the territory of using open source software and are only there to improve such things as security and performance. They are neccessary evils. But if you’re decent enough at combatting upgrade errors, they needn’t always be so evil.
Here is your mantra: Deactivate | Update | Reactivate (DUR).
Good luck with the WordPress 3.1 update :D