ZigPress

Words about WordPress from Malta

ZigPress Guide to Upgrading WordPress

WordPress

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.

11. Test!

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.

12 Comments

  1. Tanks…

  2. Im hosting with Godaddy and in which I can run “one click upgrade”. It is so easy, will take just less than a minute to upgrade. But I was not really bothered about Codebase Backup. Thanks for giving everything in details.

  3. Thank you for the post… but I don’t know why I feel comfortable with the current wordpress and no plan to upgrade it.

  4. @masdin:

    Your site is running WordPress 2.7, which has several widely known vulnerabilities. It can be hacked in about 10 seconds. You’d better hope that a hacker doesn’t find you on a Google search.

  5. Nice article, I was planning on running my own personal wordpress blog. Now if I have time I will setup right away. Thanks anyways. ;)

  6. Thankfully, Host Gator’s hosting seems to support the one-click update feature, at least when there is nothing on that particular WordPress site yet. We’ll see if it still updates correctly when the next update comes out. I have had to do it this way in the past, and it’s not fun, but it can be done. Good luck to anyone who is not computer savvy and needs to use the manual method! ^_^;;

  7. Thanks ZigPress for explaining the upgrade very well. I had some doubts about this…cleared now.

  8. This wasn’t very hard to do except for the phpmyadmin stuff. Thanks for the step by step guide.

  9. Took me time to read all the comments, but I enjoyed the article.

    graduate essay

  10. Good guide. I like it and I think I should try it on my own now…should work I hope ;-)

  11. One click upgrade is nice feature of wordpress. But there is no option to revert back to previous version like post revision. If wordpress did this, it would be a nice feature of wordpress.

  12. Thank you for the post it will help in upgrading to the lastest version..

Comments are closed