wordpress: an alternative manual upgrade

by prettyscripts on 2012-01-17 10:42

freewordpress

there are a few reasons why i don't like automatic upgrade. it updates the site directly. even though there are backups, it's a pain to roll back if something went wrong. it also doesn't work on servers that doesn't have internet presence.

there's manual update instruction. which is also directly updates the site.

this documents an alternative method to upgrade wordpress based on manual update instruction.

imo this seems to be a better solution. if there are any files other than the core file changed, the latest version is always used. the only files that are replaced are project specific files. it works on a separate site to ensure it's working. the original site also didn't have to put on maintenance mode for the process. and if anything gone wrong, simply rename the directories back to the orignal.

the essential pre steps

backup wordpress files and database. this should've been done on a regular basis.

download the lastest version and unzip. download any updated plugins.

compare wp-config.php from current site with the new wp-config-sample.php to see if there are anything new and edit if required.

the upgrade

create a new directory with the unzipped files.

based on a more detail overview of the upgrade process, note step 7 a list of "do not delete files". copy those files from the current site to the new directory, namely:

  • wp-config.php
  • wp-content/
    • delete subfolders cache and plugins/widgets
    • themes and plugins and updated plugins
  • wp-images/
  • wp-includes/languages/ - if required
  • .htaccess (if any)
  • robots.txt (if any)
  • maintenance files if any - .maintenance, wp-content/maintenance.php

rename files and complete upgrade

rename the current root folder to, say, backup, and rename the new folder to the current root folder.

from browser go to admin page. it will prompt you to upgrade.

viola!

note that the original instruction mention disable plugins before upgrade. i didn't do it to 2 of the development sites and didn't have any problems.

if you have encountered problem following instruction in this post, please leave a comment.