Upgrading from 2.4 to 2.5 via Git

Upgrading from 2.4 to 2.5 via Git

by Zied ALAYA -
Number of replies: 8

Hi everyone,

I'm running moodle 2.4.5 and I want to do an upgrade to 2.5 .

Moodle 2.4 was a fresh install via Git and I'm doing updates via Git.

Looking to this references [1] and [2] I didn't understand how to upgrade via Git !

the only command is what I'm already running to update:

 #cd moodle_directory

 #git pull

 

should I run some thing before to do the upgrade correctly ?

 

[1] http://docs.moodle.org/25/en/Upgrading

[2] http://docs.moodle.org/25/en/Git_for_Administrators

 

Average of ratings: -
In reply to Zied ALAYA

Re: Upgrading from 2.4 to 2.5 via Git

by Ken Task -
Picture of Particularly helpful Moodlers

Make a full site backup ... code directory, data directory, and an SQL dump of the db for Moodle FIRST.

cd moodlecodedir

php admin/cli/maintenance.php --enable

git pull (assures you have 2.4+)

Check version: fgrep '$release' version.php - should show 2.4.x+

git branch -a (shows branches - the 24 will have a * but 25 listed)

git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE

git checkout MOODLE_25_STABLE

Check version: fgrep '$release' version.php - should show 2.5.x+

php admin/cli/upgrade.php

after it completes:

chown apache:apache * -R

php admin/cli/maintenance.php --disable

Hit site with browser and check notifications.

'spirit of sharing', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Upgrading from 2.4 to 2.5 via Git

by Ken Task -
Picture of Particularly helpful Moodlers

Forgot to add ... probably a good idea, after the uprade has taken place and before taking site out of maintenance mode to purge all caches.

php admin/cli/purge_caches.php

If running APC or ZendOpache, etc. first access to the site might seem slower until the caches build up again.  Actually one could pause the command line stuff at taking site out of maintenance and as an admin level user login to the Moodle.  Click around to known heavy processes to help build the caches.  Then logout.

Then take site out of maintenance mode from command line.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Upgrading from 2.4 to 2.5 via Git

by Zied ALAYA -

Thank you for your quick response Ken smile

At this moment I'm solving a little issue to upgrade my php version to the request one.

I will test this as soon as possible and come with feedback.

In reply to Ken Task

Re: Upgrading from 2.4 to 2.5 via Git

by Zied ALAYA -

Ok, here I come with some feedback:

  • for the Git part: it' ok. I used this part to update the software:
    • cd moodle_path
    • git branch -a
    • git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE
    • git checkout MOODLE_25_STABLE
  • to enable/disable maintenance and the upgarde part: I visited the web pages

Little issue:

  • I get a blank page every time and the upgrade process don't launch (same described here).
  • I changed max_execution_time = 160 on php.ini and increased the memory limit to 256mb and it solved the issue.
In reply to Zied ALAYA

Re: Upgrading from 2.4 to 2.5 via Git

by Ken Task -
Picture of Particularly helpful Moodlers

The advantage of using the scripts from the command line as opposed to browser is that one may not need to change php.ini NOR have to contend with any browser issues. 

Next time, don't do *any part* via browser - including enable/disable maintenance mode and *especially* the upgrade script.  That is the one that will push server limitations.  And do run purge all caches.

But ... from what you've posted you've been successful in upgrading so congrats!

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Upgrading from 2.4 to 2.5 via Git

by Peter Ruthven-Stuart -
Picture of Plugin developers

Thank you Ken!

I too was wondering how to do a major upgrade via GIT. On reading your instructions I realised that the explanation is 'hidden' in the "Git for Administrators" doc, but to the untrained eye it is not clear that the commands used to "Obtain the code from Git" can also be used to do a major upgrade, e.g. 2.4 to 2.5.

Following your instructions I have successfully upgraded via GIT from 2.4.6 to 2.5.2 on my Mac server. Thank you.

For the record, here are the commands I used:

$ cd /Your/Moodle/Directory/
$ php admin/cli/maintenance.php --enable
$ git pull
$ fgrep '$release' version.php
$ git branch -a
$ git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE
$ git checkout MOODLE_25_STABLE
$ fgrep '$release' version.php
$ php admin/cli/upgrade.php
$ php admin/cli/purge_caches.php
$ php admin/cli/maintenance.php --disable

Average of ratings: Useful (2)
In reply to Peter Ruthven-Stuart

Re: Upgrading from 2.4 to 2.5 via Git

by Zied ALAYA -

Excellent resume Peter Yes

Thx Ken for the recommendations and your spirit of sharing.

here a little feedback:  Just tested the php call in cli and it didn’t  work.

PHP  Notice:  Undefined index: HTTP_HOST

I solved the problem using this: http://ellislab.com/forums/viewthread/194735/#1059514

hope it will be useful for some one smile

In reply to Peter Ruthven-Stuart

Re: Upgrading from 2.4 to 2.5 via Git

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, to be pedantic, this will upgrade a 'clean' 2.4 to 2.5. If you have changed anything or added any optional plugins then it's somewhat more complicated.

Personally - I would *still* follow the upgrade instructions. Copy (or move or whatever) the old Moodle code out of the way and replace it with the new (you can probably copy it and basically do the above). Then replace any plugins with updated versions.