>This morning, I managed to successfully update my Moodle 2.5.3 to the latest version of Moodle, version 2.7+. Just for the record, the update history that I’ve followed to get me to this point is 1.9 > 2.2 > 2.3 > 2.5 > 2.7. I had to upgrade both my PHP and MySQL installations to ensure that I can use this version. This new Moodle seems to be a good release as I found no problems doing the upgrade in both a test and a live environment.

If you’re reading up on how to do a Moodle upgrade for the first time, then this should be great for you. Before you do anything though, I *highly* recommend that you perform full backups of everything that you have relating to Moodle, and I do mean everything. Make sure that you’ve got a full SQL dump of your Moodle database using ‘mysqldump moodle > dump.sql‘ where ‘moodle’ is the name of your database. Do this before you do everything and make sure that the task completes successfully. Next, backup your Moodle folder and your moodledata folder (just as a precaution). I also did a virtual machine snapshot as a failover for my failover precautions. Put it this way, if it can go wrong, it usually does.

You will also need to ensure that you meet the minimum requirements for your new install which include the following:

  • MySQL >= v5.5.31
  • PHP >= 5.4.4
  • PHP OPcache enable (click here on how to install)
  • Slasharguements / URL rewriting on
  • Zlib is now required (up from recommended)

Next, clear the contents of your Moodle folder, excluding any .htaccess files (Apache) / web.config (IIS) files, as your Moodle configuration will depend on these. Copy the contents of the latest release of 2.7.x+ (available here) to your existing folder from where you’ve just deleted your files. I’d always highly recommend the ‘+’ or ‘plus’ versions as they are the ones that have been built most recently. If you have any extra plugins, blocks, enrols, themes etc. that are not part of the Moodle core, you will need to re-add these back in now in the same folder structure that you had previously. At this point, I personally go back to the folder structure remove some of the core blocks, plugins and themes that I know that I’ll never have any intention of using. This just helps to keep things nice and simple. Some things that I remove are:

  • blocks/admin_bookmarks
  • blocks/community
  • blocks/mentees
  • blocks/mnet_hosts (serves no purpose for us, or anybody that I’ve met)
  • blocks/private_files (we don’t use this as I don’t want to use my webserver as a personal file server for staff)
  • mod/assignment (no longer in use since Moodle 2.2, unless you’ve not upgraded all of your assignments using the assignment upgrade helper)
  • enrol/imsenterprise
  • enrol/mnet
  • enrol/paypal (we don’t charge for our courses)
  • admin/tool/assignmentupgrade (again, keep this unless you’ve upgraded all of your assignments)

Next, navigate to http://www.yoursite.com/admin/index.php and follow the upgrade instructions. Have a look through the checklist of prerequisites and make sure that everything on the right is labelled ‘OK’. Please take my advice and do not ignore any warnings as I know that Moodle will let you install in certain scenarios, but you can always refresh this page before you start to make sure you get a full hit of OKs. Don’t forget to restart your Apache / IIS if you make any changes so that they are reflected on this page!

Once you’ve managed to overcome the server configuration hurdles, you’ll be moving forward to the plugin pages. Again, look through and make sure that everything in there is OK. Fix anything that’s not right in there, perhaps it’s something that you’ve forgotten to re-add back in such as a plugin or something that you were meant to delete. You can always refresh this page as it won’t start the upgrade until you scroll to the bottom and hit the ‘Upgrade Moodle database’ button.

You now shouldn’t get any errors as it’s working through but if you do, you’ll need to correct these before continuing. If you don’t, then your Moodle install will fail to complete.

That there should have helped you get through. Most issues are easily fixed now and I do believe that many Moodle upgrades have become much easier over the last couple of revisions. After it’s all done, you will be prompted to log back in as administrator to complete the new settings for this release. Read through them all carefully to make sure what you’re setting works for you and your users.

Voila! Enjoy your new Moodle install! If you have any questions or comments on the above, please post them and I’ll be happy to help if I can.