Friday, April 5, 2013

Moodle Upgrading

Install - Upgrade from 1.9 to 2.x

 

1. PHP Requirements

You must set register_globals=off.
set in php.ini
register_global = Off
require: php 5.2.24

2. Change Existing DB into UTF-8

mysqldump -uusername -ppassword -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database -B dbname > dump.sql
cp dump.sql dump-fixed.sql
vim dump-fixed.sql
:%s/DEFAULT CHARACTER SET latin1/DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci/
:%s/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/
:wq
mysql -uusername -ppassword < dump-fixed.sql

3. Clone Moodle - http://docs.moodle.org/24/en/Git_for_Administrators


$ git clone git://git.moodle.org/moodle.git                     
$ cd moodle
$ git branch -a                                                  
$ git branch --track MOODLE_20_STABLE origin/MOODLE_20_STABLE    
$ git checkout MOODLE_20_STABLE                                   


You can upgrade to Moodle 2.2 from Moodle 2.1, 2.0 or 1.9. If you are upgrading from 2.0, please also read Upgrading to Moodle 2.1 . If upgrading from 1.9, please also read that and Upgrading to Moodle 2.0. After reading this you can upgrade directly to 2.2.

4. Access your Moodle (ie: http://localhost/moodle)

- It will automatically update

5. Checkout again

(ie: MOODLE_21_STABLE, MOODLE_22_STABLE, ...)
do step 3
- $ git checkout MOODLE_21_STABLE
do step 4 
- $ git checkout MOODLE_22_STABLE
do step 4 

till the stable version of moodle that you one & done.
So you both upgrade database as well as source code of moodle.