Recent attacks have shown that keeping WordPress installations up-to-date is absolutely vital. If you have WordPress installations and they’re not yet running at least 2.8.4, ask yourself why not?
Self-hosted WordPress upgrades are supposed to be really easy, but the “one-click” upgrade process is flawed and only works on certain hosts, and these certain hosts sadly do not include mine. So for all my WordPress installations, I have to follow the manual process, using FTP. It usually takes me about 15 to 20 minutes per site.
I have decided to make a post summarising my upgrade process, partly for my own reference (it saves me searching for bookmarks or Word documents) and partly because it may be a useful reference for some of my readers who create and deploy WordPress sites.
Being a fairly recent convert to WordPress, I have only used this process when upgrading from version 2.7 onwards, though in theory it should work back to version 2.5.
This guide also assumes your local PC is running Windows, though it should be effectively the same on a Mac or Linux machine.
All steps are absolutely essential.
1. Upgrade Plugins
Browse to your admin plugins page and make sure that no plugins are showing that a new version is available. Update any that are, except the default ones (Akismet and Hello Dolly) – these will get updated automatically.
2. Backup Database
You can use phpMyAdmin if your host has it or you have installed it, or you can use a desktop application such as SQLyog. Just make sure you have a complete copy of the database, either in an SQL dump file or a working copy on your local MySQL installation.
If you do a direct copy to a local MySQL installation, make sure you can view the tables. If you save to a dump file, make sure you can view the file in Notepad or a similar editor.
The WordPress site has a help page for this step.
3. Backup Codebase
Create a folder on your desktop or anywhere you prefer, connect to your site using FTP, and download the entire WordPress site to the folder you created. If your WordPress installation is in a subfolder, download that folder. This includes any extra files that have been created to support the WordPress installation, such as .htaccess.
Open a few of the files you downloaded in a text editor, to make sure they’re readable and not corrupted.
4. Get Upgrade Ready
Download the latest version of WordPress from the official download page – nowhere else. Unzip it to a folder in a convenient location (e.g. desktop).
If you have altered any core files in your current installation, now is the time to make the same changes to the fresh installation you just downloaded – but keep a backup of any files you change.
5. Deactivate ALL Plugins
On your site, login as an administrator, and deactivate every single plugin. Then go to the Dashboard (admin front page) and leave that browser window open.
This is where the upgrade begins in earnest. From this point until you’re done, your site will not respond properly for users. But don’t rush it! That way mistakes are made.
6. Partially Delete Existing Installation
Using FTP, delete the following files and folders. Be VERY careful not to delete anything else.
- These files in the site root or main WordPress folder: index.php, readme.html, license.txt and xmlrpc.php
- All files in the site root or main WordPress folder that start with “wp-” EXCEPT wp-config.php
- The wp-admin folder
- The wp-includes folder (but if you have a wp-includes/languages folder, don’t delete that – just delete the rest of the contents of wp-includes instead)
7. Upload New Installation
Make sure your FTP program’s remote window is showing the site’s root or main WordPress folder contents, then upload the contents of the fresh installation folder that you downloaded in step 4. Some files in wp-content will be overwritten (for example, there may be new files for the default plugins) – don’t panic.
Once this is complete, delete readme.html, license.txt and wp-config-sample.php from the live site – you don’t need them.
8. Run Upgrade
Go back to your browser window that is showing the Admin Dashboard and refresh the page. WordPress will detect that it has been upgraded, and will make any required database changes.
Note: if there are no database changes to be made, the Dashboard will simply refresh and show the new version number.
9. Refresh Admin Settings
Go to the Admin Permalinks page and re-save the settings.
10. Activate Plugins
Activate each of your plugins, one by one, and browse relevant pages in your site after activating each plugin, to make sure there are no problems. If something goes wrong, deactivate the offending plugin and seek guidance from the plugin author’s page.
Go through your entire site and make sure all is well. Then reward yourself with chocolate, beer, a cigarette, etc.
Did I miss anything? Leave a comment.