Monday, May 14, 2012

Moodle 2.2 To 2.3 upgrade

As administrator, one of my primary responsibilities is keeping moodle core code up to date.  When to do this is a good question.  All factors equal, I should update core moodle code with updates when they are officially released by the moodle core team. Today, an announcement was made to that end.

Prior to installing the update, I am making a list of any changes I have made to the moodle core.  I am assuming changes to the moodle core in my 2.2 installation will be lost or overwritten by the upgrade to 2.3.

I have updated one of the core themes.  I am *pulling those changes to the core theme, anomoly, and placing into another custom theme that someone created for me.  Essentially, the custom theme called au, is a duplication of the core theme anomaly.  Miriam Laidlaw was nice enough to duplicate the theme for me.

I also have a custom sql reporting plugin that I installed a few weeks back.  I think I will lose that too, and have to re-install it.

I updated the permissions of one of the core roles too, manager.  I expect to lose those changes too. I did NOT lose the permissions changes made to a core role.

What changes will be lost to the core?

  1. theme
  2. plugin
  3. permissions (not these - they seem to migrate ok)
This page contains directions for the upgrade.  In a nutshell, its not too fancy, the steps:
  1. Move your old moodle program files off the server
  2. Add the new program files to the server
  3. Copy the root config.php file from the old files to the new
  4. Run the notifications
  5. Put back theme or plugin directories from the old files into the new files
  6. Let moodle complete the plugin checks.
I went to this page and clicked the download link to the package I was after.  The size of the zipped file was 30 MB.  I unzipped the file to a network space, the extraction process took about 5 minutes.  May be a little slow since extracting to network drive -vs- local drive. The size of the extracted directory is about 91 MB.

I am renaming the current moodle directory to moodleOLD, then copying the newly extracted moodle directory to the server. I had to close my browser that had a reference to the moodle instance and my editor that had a reference to the moodle instance BEFORE i could rename the current moodle folder from moodle to moodleOLD.  Once that was done, I copied the new moodle folder to the server, when that was done copying, I copied the config.php file from the moodleOLD folder into the moodle folder.  Then I opened a new browser window to the server and was greeted with a message from the new moodle version build # ... that it was going to update the DB.  Then the server checks screen.  Then the plugins check screen with a number of native plugins (Database and Workshop and a couple Enrollment methods).

When I was able to log back in, there were two new settings file added to moodle 2.2.3, I accepted the defaults of each. Actually, one of the settings was an option to use the course file name rather than the id # in the automated course backup strategy.  Nice, I had mentally complained about this a couple weeks back.

Visual verification of upgrade

When I click on notifications, I can see the reference to the newer version of moodle 2.2.3 (build:20120514)

Still having trouble with the duplication of the anomaly theme, when I copied the duplicated theme, update the version # and refresh (greeted by plugin update GUI) everything seems ok.  When I try to clear the Theme cache or pick a different standard theme, I get the white screen of death.  The error logs report

[14-May-2012 16:34:11 UTC] PHP Fatal error:  Cannot redeclare class theme_anomaly_core_renderer in C:\wamp\www\moodle\theme\au\renderers.php on line 84

I solved the bug and now have the custom theme named au installed, and selected.  I also copied the anomaly theme from the latest moodle extraction back into my moodle directory.

I will now put back the two plugins I had installed.

High level steps for next upgrade

  1. maintenance mode
  2. get zip file from website, download and extract to my share network space
  3. close any editor or browser that has a session active with the moodle version to upgrade
  4. rename the moodle folder from moodle to moodleOLD
  5. copy the extracted moodle folder from the network space to the www root folder (where current moodle folder exists)
  6. copy the config.php file from the moodleOLD folder to the moodle folder
  7. initiate a new browser session and browse the site
  8. Allow the DB and update
  9. Continue through the Server checks (if server needs updates, then update it)
  10. Continue through Plugins check (don't get too nervous if you see things you did not expect - its just communicating things that have changed)
  11. Copy the au them from moodleOLD into moodle
  12. Update the au them version #
  13. Refresh and Continue through plugin update
  14. Activate the au theme.
  15. Copy the report\customsql folder from moodleOLD  to moodle
  16. Update the version # in customsql
  17. Copy the block\student_manager folder from moodleOLD to moodle
  18. Update the version # in student_manager
  19. Copy the files from the \local folder in moodleOLD to moodle 
I will also have to re-install the questionnaire module, which I installed after this upgrade.  I also activated the feedback module.  I expect that would be ok, since moodle seems to be keeping the settings in place upon upgrade.

I have also added the checklist module.  Will I have to re-install or will moodle keep my plugins and their settings when I do an upgrade?  I think it will, its the tweaks to the core code that are lost upon upgrading.






1 comment:

  1. I want to thank you for this post. My brain was literally about to spill out of my ears trying to understand exactly how to complete a Moode upgrade (I have no technical experience, but I can read and follow directions).

    I followed yours to the letter and it worked! May scores of cherubic angels serenade you and throw rose petals and gherkins at your feet.

    ReplyDelete