This page will show you how to get a portable Moodle 2.7 up and running. It includes a small hack to get Moodle to accept an older version of MySQL.
This also follows on from my previous Portable Moodle 2.3 page which shows how to get a portable Moodle instance that is good up to 2.6.
I’m assuming you already know file management, you’re confident editing files with notepad (notepad++ is nice) and probably enjoy getting your hands dirty messing with the back end stuff.
You will need:
- Mowes Portable Server
- PHP I’ve got this working with PHP 5.4.33.
When tested with 5.4.35 curl stops working and Moodle wont upgrade to 2.7
- The latest Moodle 2.2+ zip file
- and 2.7 zip files (but I’ve got this working with 2.8)
I’d recommend the following:
- When upgrading or editing any files or folders , stop the server.
- After upgrading or editing files/folders, complete the upgrade by starting it up again. Refresh your Moodle page or go to Site administration –Notifications and follow upgrade instructions.
- Delete zip files and old folders as you finish with them to cut down on mix ups. Alternatively just move them to a separate folder for back up.
Installation: Mowes Portable Server.
- Unzip mowes_portable.zip
- Double click on mowes.exe in the unzipped folder
- Clickety click on the options
- Once installed mowes will start all the relevant software and launch your browser automatically. If it doesn’t, then double click mowes.exe and it will launch apache and mysql.
- Start your browser and type localhost/moodle in the address bar. Your login details are:
Upgrade Moodle to 2.2
- Rename the mowes portable/www/moodle folder to moodle.old
- Unzip the moodle 2.2 into mowes portable/www and rename that to moodle
- Copy config,php and moodledata from the old moodle folder to the new one
- Locate and edit php.ini. You’ll find this in the php5 folder. Open this with notepad and find the line:
;extension=php_curl.dllon this page
Uncomment the line by deleting the semicolon at the beginning.
- Save php.ini
- Copy and paste the following from the php5 folder to the apache2/bin folder:
- Start the Moodle upgrade process in your browser.
- Rename the php5 folder to php5old
- Unzip the new php 5.4 zip file and rename to php5
- Copy and paste the php.ini from the php5old folder to the new php5 folder
- Copy and paste all icu*.dll ‘s
- Copy and paste php5/ext/php_sqlite.dll from the old to the new folder
- Copy and paste php5/ext/php_intl.dll into apache2/bin
- Copy and paste all icu*.dll’s from the php5 folder to the apache2/bin folder
Upgrading Moodle to 2.7
If you’ve got this far then you’ll already have a clear idea what to do here.
- Rename moodle folder
- unzip your 2.7 zip file into the www folder and rename to moodle
- Copy the config.php file and the moodledata folder from the old moodle folder to the new one.
- Edit www/moodle/admin/environment.xml (notepad wont display this well. Try Wordpad)
Near the bottom, just below the line <MOODLE version=”2.7″ requires=”2.2″> find the line <VENDOR name=”mysql” version=”5.5.31″ /> change the version number to 5.5.8 and save.
- Start the server, go to notifications, clickety click and bobs your uncle.
Upgrading to 2.8
The same as the step above but when you edit environment.xml you need to change the mysql number to 5.5.8 for both:
Hacking Moodle’s Server Environment – Discussion
To make the upgrade to 2.7 I’ve had to bypass the requirement to upgrade MySQL by editing www/moodle/admin/environment.xml
I’ll be frank, I got my head around upgrading PHP in less than an hour just using google but MySQL is a different kettle of WTF. Re-reading the manual yet again merely confirms that I don’t have the right skill set and need a walk through like the one I’ve written above so I’m personally very happy to be able to hack away the need to upgrade MySQL. There’s going to come a time, though, when I’ll want a 2.8 and a 2.9. By then I’ll need to have got the skill set to make that happen otherwise I’ll have to hack a bit more and I’ll be in danger of producing a reduced version of Moodle with missing capabilities, which is not what I’m after.
If, in the meantime, anyone who can do the MySQL upgrade want’s to share then please do. You can comment here or message me on twitter @nearlyvirtual.
As far as I know, this is the ONLY properly portable 2.7 available. If you know different, please share.