Moving to Moodle 2.0: Pt.2 The Tools and Tweaks

Before begin­ing any project you want to make sure you have the tools to do the job.  In the case of a Moo­dle 2.0 migra­tion you bet­ter have a really good set of tools.

Relax, all right? My old man is a tele­vi­sion repair­man, he’s got this ulti­mate set of tools…” ~ Jeff Spi­coli — Fast Times at Ridge­mont High

Jeff Spi­coli was right and here is an “ulti­mate set of tools” to make migra­tion magic hap­pen.  This is not a “hot-to” of an actual migra­tion, rather the set-up work that needs to hap­pen before actu­ally migrat­ing a Moo­dle install to a new box, in this exam­ple, an Apple server.

The Hard­ware.

This post describes the steps to take when mov­ing from a Linux server (Cen­tOS) to an Apple Mini Server run­ning Snow Leop­ard Server (10.6.7). The Apple server is con­fig­ured with a 2.66 Ghz Core 2 Duo proces­sor, 8GB of RAM and mir­rored 500GB hard dri­ves.  As Snow Leop­ard server has Apache, MySQL and PHP installed there is lit­tle to do here other than to acti­vate the services.

Acti­vat­ing the Ser­vices (AMP)

Moo­dle requires three things to be run­ning on a server: Apache, MySQL and PHP (AMP).  While these are installed on a Snow Leop­ard server they need to be activated.

1. Launch ‘Server Admin’ and from the ‘Set­tings’ tab check the ‘Web’ and ‘MySQL’ ser­vices and click the ‘Start Web’ and ‘Start MySQL’.

This starts the Apache web server process and the MySQL data­base engine.

2. On the ‘Web -> Set­tings’ tab check the ‘php_5 mod­ule’ and save the set­ting.  This allows Apache to under­stand and process the php files used by Moodle.

3. On the ‘MySQL -> Set­tings’ tab ‘Set the MySQL root pass­word…’ and save the setting.

You can’t turn on the MySQL process with­out set­ting this password.

All the mod­ules are now run­ning on the server to sup­port Moodle.

Where the data live.

With the AMP ser­vices run­ning data can now be placed in the appro­pri­ate folder(s).  The major­ity of the hosted files will be stored in ‘Library -> Web­Server -> Doc­u­ments’.  Make an alias to this folder and include it in the side­bar or in the Dock for easy access.

Installing and “tweak­ing” php­MyAd­min and

php­MyAd­min pro­vides a GUI inter­face to a MySQL data­bases.  This tool will allow for the cre­ation of the Moo­dle data­base, pro­vides access to the tables and numer­ous other tasks. Down­load php­MyAd­min here:

There are instruc­tions on the php­MyAd­min web­site, the fol­low­ing are the steps taken to tweak the doc­u­mented install to allow for larger files to be used which can accom­pany a Moo­dle migration.

1. Drag the copy the php­MyAd­min folder in the Library -> Web­Server -> Doc­u­ments folder.  Renam­ing the folder is rec­om­mended as there is a poten­tial secu­rity risk with expos­ing the folder.

2. Within the ‘php­MyAd­min’ folder cre­ate a folder call ‘upload’.  This will be used in Step 7 below.

3. From a web browser nav­i­gate to web address of the server and the folder -> http://YOURSERVER.COM/phpMyAdmin and enter the ‘root’ user and the pass­word from the set-up in the MySQL sec­tion above.

4. php­MyAd­min pro­vides the abil­ity to con­fig­ure a SQL data­base for use with Moo­dle. Try to resolve any error that are pre­sented at the bot­tom of the window.

The ‘secret passphrase’ error is fairly com­mon and can be resolve eas­ily while the sys­tem will func­tion if the ‘mcrypt’ error is ignored.

5. To resolve the ‘secret passphrase’ error open the ‘’ file located within the php­MyAd­min folder and add the secu­rity phrase between the sin­gle quotes on the line: $cfg[’blowfish_secret’] = ; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

(Resource link:

6. Changes will need to be made to the’ file if  large file(s) need to be imported.

The line ‘$cfg[’ExecTimeLimit’] = 600;’ will need to be added to the file to change the time limit that a script can run.  This limit can be adjusted based on the size of the files to be uploaded/imported.

(Resource link:

7. To bypass the 2MB file size upload limit open the’ file and edit the ‘$cfg[’UploadDir’]’ line to ‘$cfg[’UploadDir’] = ‘./upload’;’ to use the upload folder cre­ated in Step 2 above.

(Resource link:

All of the “tweaks” to the ‘’ file are now complete.

“Tweak­ing” the php.ini file.

1. The ‘php.ini’ file live in the ‘/etc’ folder, which is not viable by default. To access the folder use the ‘Go -> Go to folder…’ com­mand and type ‘/etc’.

2. The ‘memory_limit’ needs to be increase from 128MB to some­thing larger depend­ing on the amount of data to be trans­ferred.  (2GB of data =  2048MB or 4096MB for bet­ter per­for­mance, depend­ing on avail­able RAM).

3. The ‘max_execution_time’ and ‘max_input_time’ will need to be increased as well.  Again, this is depen­dent on the size of the file(s) to be uploaded.  Dur­ing test­ing the limit was set to 600.

These are all of the sys­tem tweaks needed before get­ting started.  There are a few more things which may need to be addressed such as the data­base table col­la­tion and adjust­ing the data­base type from MyISAM to InnoDB.

The fol­low­ing soft­ware tools and rec­om­mended read­ing will pro­vide the most “ulti­mate set of tools” for your Moo­dle migration:


In my next post I will detail the steps taken to get data sync’d between an active Moo­dle server and a new server.

If you missed Pt.1 in this series you can read it here: “Mov­ing to Moo­dle 2.0: Pt.1 The Deci­sion”.


About William Stites

Currently the Director of Technology for Montclair Kimberley Academy, "Blogger in Chief" for, husband and father to two crazy kids who make me smile everyday.
This entry was posted in Moodle, Technical and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.