Remember, moodle consists of a couple pieces,
- a DB
- code base (php)
- a configuration file that links the two (config.php)
- a location where all the site files go. (moodledata)
The steps you should follow prior to upgrading your moodle site
1 - back up your DB - just in case
2 - back up your code folder - just in case
a - I like to rename the live folder foldername_old_version_#
3 - put your site in maintenance mode - in case users are logged in
4 - create a new folder with the same name your original folder had in step 2
5 - copy the configuration file from the renamed folder (step 2) into the new folder
6 - Get the updated moodle code from somewhere
7 - Unzip the updated moodle code into the new folder where you just copied the config file
a - I like to unzip it into a different location and then do a copy - paste
8 - Browse the site and the upgrade kicks off...
This process is a little tedious and error prone - since there are a lot of steps to remember, PLUS, we have not even addressed the plugins that may have been in place in your old moodle code - that will need to be PUT BACK into the new code.
The plugin check is the second step during the upgrade, right after the server check. Now you COULD be a good soldier and copy the plugin code from the code base in step 2 into the new code base - this is probably a good idea most of the time. Otherwise, moodle will prompt you in the Plugins step of the upgrade to go and get the plugin code and put it in place. Newer versions of moodle have a nice feature, where there is a button that you can click and the install process will actually attempt to go and get the plugin code and install it into the proper location in your code, not bad, but often does not work. You often times have to go get the plugin (download), unzip, read the installation or readme file, so you know where to put the code and then kick off the upgrade again.
These are the four little hiccups I ran into upgrading six of my moodle instances last week
1 - I was lazy and bypassed steps 1 and 2 - and simply deleted the code and dumped new code in the same directory. Opps, when I kicked off the upgrade - moodle started asking me for DB names, moodledata locations. My blood pressure went up a little, only a little, since this was really a practice instance, that does not have much real traffic. I went to another instance, copied the config.php file into the directory, updated the values in it (DB, user, moodledata folder etc) and the upgrade jumped to plugins - which was minor and then completed.
2 - When I kicked off the upgrade, the plugins step was requiring me to upgrade a plugin called HotPots - a quiz creation tool. I forgot about this and could have used the code from step 2, and copied and pasted it into the new code folder, BUT, I skipped step 2 ;( so had to go find the HotPots plugin, download, find the directions about where to copy the code in the new directory. This was a little stressful, but not too bad.
3 - Again, I skipped steps 1 and 2 and simply dumped the old code and plopped the new in the directory - leaving the config.php file. When the plugin step popped up I remembered a custom theme that had been created for the site. Hmmm, a custom theme, not one that I could go download anywhere - blood pressure starts to rise, since I skipped step 2, again. Bad James, bad. I looked around my server hoping I had backed up the directory somewhere, so I could find the custom theme called au in the themes folder....nothing. Keep calm, deep breath. I remembered the recycle bin! Looking in there I could see all the old code I had just deleted, I browsed into the theme folder in the recycle bin and was able to copy the au folder to the server desktop and then into the code directory. I refreshed the upgrade plugin screen and was on my way! A close one, blood pressure dropped immediately.
4 - Once again, I skipped steps 1 and 2 and simply dumped the old code and put the new in the directory. Kicked off the upgrade and at the plugins screen was greeted by a missing plugin called exaport. I had no knowledge of this block, not that i remember. How did it even get there? Not sure - but I was able to find the plugin, download, unzip and place into the directory where required and complete the upgrade process.
The moral of the story?
Please do not skip steps 1 and 2 - always have a path back to pre-upgrade state. Period. Do not be lazy. It takes 5 minutes to complete these two steps, sometimes even less. I have a mechanism in place the makes the DB backup very quick and painless.
Plugins are a pain. Avoid them if possible. When you do an upgrade, be prepared to upgrade the plugin too. Even if you copy the plugin code from the old code base to the new, you may have to get a newer version of the plugin.
Plane you upgrades, even if its a maintenance upgrade, like 2.6.2 to 2.6.11 - it STILL involves removing the entire code base and placing a new one in its place.
No comments:
Post a Comment