If you missed the announcement, no problem, you can catch it here–Moodle 2.2 is available! The upgrade from Moodle 2.1 to 2.2 didn’t take all that long. The process was also straightforward (at least, the way I do it…I know others have different approaches). Before I go much further, I want to be up front and say “I’m not an expert” and I’m learning this as I go. That said, it has worked for me and I’m open to new and better approaches.
1) On RedHat Linux server, but this will work on UbuntuLinux since I’ve tried it out there, too, you can start in this way:
~$ sudo su
~$ rm -rf $(ls -d –file-type /var/www/html/moodle_directory/* | grep -v config.php)
This first puts you in admin mode, then removes all files in the Moodle directory except the all important config.php file. You essentially have an empty directory except for the config.php file.
2) Copy the Moodle 2.2 php files to the moodle_directory:
~$ cp -rv /home/mguhlin/moodle22/* /var/www/html/moodle_directory/
Before taking Step 2, if you have any custom blocks, mods, themes, it would be a good idea to plug them in the right places. I keep copies elsewhere so I can easily copy them over in one fell swoop. To be honest, I haven’t settled on my favorite mods in Moodle 2.x yet (aside from Book and Certificate).
3) Go to the Notifications page of your Moodle site
I wish I knew if there was a way to do the upgrade process via the command line rather than the notifications page on the web. Something I need to do more research on!
An alternate way of automating all this, especially if you have multiple instances of Moodle running is to setup a bash script (which I’m still a newbie at making)…copy-n-paste, customize and save as “upgrademoodle.sh” then execute it with sudo sh ./upgrademoodle.sh
echo “Starting Moodle instance upgrade….”
rm -rf $(ls -d –file-type /var/www/html/moodle_directory/* | grep -v config.php)
cp -rv /home/mguhlin/moodle22/* /var/www/html/moodle_directory/
rm -rf $(ls -d –file-type /var/www/html/moodle_directory2/* | grep -v config.php)
cp -rv /home/mguhlin/moodle22/* /var/www/html/moodle_directory2/
echo “Halfway through….”
rm -rf $(ls -d –file-type /var/www/html/moodle_directory3/* | grep -v config.php)
cp -rv /home/mguhlin/moodle22/* /var/www/html/moodle_directory3/
echo “Upgrade Complete”
Does it work? Yes…I did 14 Moodle instances quicker than you could blink with this approach. Of course, you want to make sure that Moodle22 directory has everything you want in it before you start. This approach can also work on Mac Snow Leopard servers.
Doing things via the command line has been an exhilarating experience…and things move faster at the command line (which keeps you alert!).
Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
Everything posted on Miguel Guhlin’s blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure