Portable Moodle 2.7

 

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.

If you just want to play with Moodle 2.7 without having to mess about with all the backend stuff then grab yourself a package from Moodle.org. This isn’t a truly portable solution but if you’re prepared to crack open notepad every time you move it it’s quite a good test environment.

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:

Workflow

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.

mowes

Mowes was produced buy CH Software. They have shut up shop but Mowes is GPL’ed.

I’ve kept a copy for my own use and have been offering it for download for a while. There are alternatives but as far as I’m aware, this is the only fully portable Moodle 2.7 available anywhere.

I’d be interested to hear from people who know different.

  1. Unzip mowes_portable.zip
  2. Double click on mowes.exe in the unzipped folder
  3. Clickety click on the options
  4. 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.
  5. Start your browser and type localhost/moodle in the address bar. Your login details are:
  • admin
  • password

Upgrade Moodle to 2.2

  1. Rename the mowes portable/www/moodle folder to moodle.old
  2. Unzip the moodle 2.2 into mowes portable/www and rename that to moodle
  3. Copy config,php and moodledata from the old moodle folder to the new one
  4. 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.
    Also uncomment:
    openssl
    xmlrpc
    soap

    intl
  5. Save php.ini
  6. Copy and paste the following from the php5 folder to the apache2/bin folder:
    libeay32.dll
    ssleay32.dll
  7. Start the Moodle upgrade process in your browser.

Upgrading PHP

  1. Rename the php5 folder to php5old
  2. Unzip the new php 5.4 zip file and rename to php5
  3. Copy and paste the php.ini from the php5old folder to the new php5 folder
  4. Copy and paste all icu*.dll ‘s
  5. Copy and paste php5/ext/php_sqlite.dll from the old to the new folder
  6. Copy and paste php5/ext/php_intl.dll into apache2/bin
  7. 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.

  1. Rename moodle folder
  2. unzip your 2.7 zip file into the www folder and rename to moodle
  3. Copy the config.php file and the moodledata folder from the old moodle folder to the new one.
  4. 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.
  5. 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:

<MOODLE version=”2.7″
and
<MOODLE version=”2.8″

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.

Leave a comment

22 Comments

  1. bam0382

     /  August 7, 2014

    Great Job, thank you!

    Reply
  2. Krunal

     /  November 7, 2014

    I am new developer to Moodle and have to give support at client site.
    Your package make life so easy to setup environment.

    Thanks a lot

    Reply
  3. Hey Sam, I tweeted you but thought I would contact you here. Sorry to be a bit obtuse, but I either get a fatal error “$CFG” and the program exits OR I get a cURL error in Moodle saying it must be configured – but it is. I’ve followed your directions step by step (and thank you so much) but I’m still stuck. Any suggestions? I’ve done the process twice over with the same problem. Win7 32bit machine. Thanks. Any help greatly appreciated. Julie

    Reply
  4. Hi Julie,

    At what point do you get the first error? Is it at the upgrade to 2.2, upgrading PHP or the lat upgrade to 2.7?

    I haven’t had a chance to test my process today to see if I can replicate the problem so some pointers for where it goes wrong for you would be helpful.

    Reply
    • Julie Freeman

       /  December 4, 2014

      Hi Sam,

      Thanks so much for responding. Everything worked perfectly until the upgrade to 2.7. That’s when “clickers-click” sadly didn’t work. The first error was a red “check” for installing curl. I went back and redid the steps outlined for editing the pup.ini file and upgrading PHP. (I’m totally unfamiliar with pho, xml, yada yada yada, and completely reliant on your instructions!)

      In the instructions Upgrading Moodle 2.7, when you say “old old Moodle folder”, do you mean from the initial Moodle install folder or the 2.2 upgrade folder?

      Sorry Sam. I appreciate your help. It’s a great thing this workplace is trying to do so I really would love to get this working for them.

      Julie🙂

      Reply
      • The problem is in the PHP upgrade. The current PHP 5.4.35 release causes the curl error. Using 5.4.29 still works fine – it can be downloaded here: http://windows.php.net/downloads/releases/archives/

        I’ve updated the page to reflect this.

        Use the 2.2 upgrade folder, not the original. (“…old old Moodle folder…” is a typo, I’ve corrected it)

        Thanks again for the headsup on this problem.

  5. Hello Sam,

    May thanks first of all for doing this. I am encountering trouble with two aspects of the php update to 5.4.29 (I am assuming that the thread safe version will do). Firstly, probably easy to fix, I have assumed that the ” php5/ext/sqlite.dll ” in PHP Update item 5 is actually “php_sqlite.dll”, coming from the old php5/ext folder into the new php5/ext folder. Could you please confirm that that is what you meant?
    Secondly, on update to Moodle 2.7, the server checker is moaning about the intl extension not working. I have copied the php_intl.dll from the updated version into the apache2/bin folder, but apparently that does not get picked up. That was not a problem with the upgrade to incl. 2.3. I have also tried to use the php_intl.dll of the old php package, but the result is the same. Any ideas how to fix that?

    Thanks a lot and best regards
    Ernst

    Reply
  6. Great! Thanks a lot. Having said that, I figured out that 2.8 works okay without the intl extension. So, while Moodle says it is a nice-to-have, it is not urgent or mission critical.

    Reply
    • I’ve now updated my page to say php_sqlite.dll. Thanks for the heads up.

      Although you don’t need intl I’ve found the solution on this page. In short, copy all ICU*.DLL’s from the /php5 folder to the /apache2/bin folder and restart the mowes server.

      From what I’ve read I think a better solution would be to edit the server config but that’s outside my current time and skill constraints. Now the only server environment thing that doesn’t check out for me is opcache. Maybe a project for the future.

      Reply
  7. muluesk

     /  March 11, 2015

    Hello Sam,
    Great job. I was trying to make the xampp build to work on a usb for weeks now, but no success. You did a great job, and I agree this is the only portable moodle out there, works great. I just dropped in the latest version 2.8.5 hoping it would do some magic, but didn’t work. tried the steps above, but I just get blank page. let me know if you had time to upgrade to 2.8.5, and the steps you took.

    thanks man, you saved me a whole lot of time. keep up the good work

    Reply
    • Hi Muluesk,

      I’ve had no problems. I just repeated the steps above for a standard moodle upgrade (inc hacking environment.xml). I started with a 2.8.1 site but I can’t imagine there would be a difference going from 2.2 to 2.8.5 than 2.2 to 2.85 via 2.81. What’s the last upgrade version you had that worked?

      I’m not sure what else to suggest. I’d probably start with the apache logs: ../apache2/logs/error.log

      Good luck.

      Reply
      • muluesk

         /  March 13, 2015

        Thank you Sam. I missed the environment.xml part. I was able to upgrade and works perfectly. I was also able to put is in a portable app, and launches great. By the way one more thing I’m hung up on is that, I’m trying to start mysql in a different port other than 3306. I changed the port in my.ini file, but mysql refuses to start on a different port. Let me know if you have any tricks to make mysql start on a different port.

        thanks

      • Will do. I’d be interested in what you did to put it in a portable app if you’re up for sharing.

  8. muluesk

     /  March 15, 2015

    how selfish of me would it be not to share. here is what I did.
    – download portable app platform from http://sourceforge.net/projects/portableapps/
    – install portableapps somewhere, you can do it on usb or on C:\ drive. I saved it on my C:\drive so that it is faster to setup stuff and finally copy it to usb. I installed mine under
    C:\MoodleOffline
    – once installation is done, open C:\MoodleOffline\PortableApps using windows explorer.
    – Create a folder under PortableApps, mine looks like C:\MoodleOffline\PortableApps\Moodle
    – Then copy all the contents of your working project i.e apache2, mysql, php…. I mean everything, dump it in your newly created folder, C:\MoodleOffline\PortableApps\Moodle.

    that’s it. when you start portableApp now, it will automatically detect the app and puts it in the left pane so that you can start it.

    let me know how it went.

    thanks

    Reply
  9. Hi,

    Thanks for sharing this information, I am now running Moodle 2.9 portable🙂

    Regarding the MySQL upgrade, the following steps worked for me:

    1. Rename mysql folder to mysql.old
    2. Download mysql 5.5.47 zip package (Win32 version) from http://dev.mysql.com/downloads/mysql/ and expand to mysql folder
    4. Copy my.ini from old folder to new
    5. Copy data/moodle from old folder to new
    6. Copy data/ib* from old folder to new

    Reply
    • Thanks Vitor. nice to know people are still finding this page useful.

      I’ll have a go at the mysql upgrade later and update my post acordingly. It would be nice if I can keep it going with Moodole 3.0 and above.

      Reply
  10. Kristian

     /  February 8, 2016

    Hi Sam,

    Great post. I’d like to try and create an offline backup of my site following your instructions, but I’m not sure how I’d upload the SQL file. Any ideas? I got a data dump out of my old phpmyAdmin but I’m not sure what to do with it now.

    Reply
    • Hi Kristian,

      I’ve just done something similar with a wordpress site amd I used a bitnami stack to produce my local installation – it came with phpmyAdmin as part of the package so you can just upload the dump. They also do a Moodle stack too: https://bitnami.com/stack/moodle although I’ve not checked that phpmyAdmin is there as standard and even though it’s a local installation, it’s not portable.
      Failing that then reading the mysql manual or using the moodle.org forums.
      Good luck.

      Reply
  11. Kristian

     /  February 8, 2016

    Thanks Sam. I’ll look into that. I’m also going to give USBWebServer a try. http://linuxandfriends.com/usbwebserver-webserver-on-a-usb-stick/

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s