Upgrade a manually installed Moodle with GIT

Upgrade a manually installed Moodle with GIT

by Sergio Úbeda -
Number of replies: 5

Hi!

I have a server with Moodle 3.5.x that was installed and configured just downloading and installing the files. Server is with Ubuntu 16.04.4 LTS and PHP 7.1

To facilitate future updates of the core I would like to add GIT to this installation and update in the future simply with "GIT Pull" (i have other servers in that way).

Would it be enough to follow the instructions of https://docs.moodle.org/35/en/Git_for_Administrators? Or that instructions are only for new installations?

My intention is to first upgrade to the latest version 3.5.x and in the near future migrate from 3.5.x to 3.8.x.

Thank you very much,

Average of ratings: -
In reply to Sergio Úbeda

Re: Upgrade a manually installed Moodle with 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
There are a few ways to do this but the easiest is...

* Somewhere different to your main installation, clone the Moodle git repo
* Check out branch MOODLE_35_STABLE
* Remove the existing code and replace with the git clone. Copy config.php back over
* Run the upgrade script.

If you have optional plugins in the mix then it's a slightly different matter. What I do is to have my own account on Github, fork Moodle and then add the plugins such that I have my own custom version.
Average of ratings: Useful (2)
In reply to Howard Miller

Re: Upgrade a manually installed Moodle with GIT

by Sergio Úbeda -
Thanks for your replies! Howard and Visvanath.

I'll do the trick of using another folder for the installation of git and then copy config+plugins.
And in the future I will look for the solution of my own fork of Moodle.

Last question: I understand that if I install with git MOODLE_35_STABLE any later git pull will update that branch. So if later I want to upgrade from 3.5 to 3.8 wich git command I have to use?

Thanks!
In reply to Sergio Úbeda

Re: Upgrade a manually installed Moodle with GIT

by Ken Task -
Picture of Particularly helpful Moodlers

Just one additional suggestion ... check plugins for compatibility with destination core version of Moodle.

Above can be scripted and checked via moosh.

addons.txt file list addons by shortname:

atto_morefontcolors
auth_saml2

Using moosh to check those using a bash shell script:

#!/bin/bash
#
echo 'Add-on listing: ';
cat ./addons.txt;
echo '---------------------';
for i in `cat ./addons.txt`
do
   echo "Addon in que: $i";
moosh -n plugin-list |grep $i
done

Themes are plugins and probably should be the first thing to research about newest version of moodle core code.

Be a good 'boy scout' and be prepared for a theme snafu.

Add a line to config.php commented out but ready to use in the event theme not compatible with latest/greatest ...

// $CFG->theme='';

'SoS', Ken

Average of ratings: Useful (1)
In reply to Sergio Úbeda

Re: Upgrade a manually installed Moodle with GIT

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
A brute-force method for a fresh start, assuming you haven't touched the code, would be to:
- rename the moodle directory
- get MOODLE_35_STABLE as documented in in https://docs.moodle.org/35/en/Git_for_Administrators#Obtaining_the_code_from_Git
- copy the additional plug-ins that were in the old moodle to the new place
- login as admin and visit the notifications page. It will take you through a minor upgrade.

That's all. Of course, you'd want to operate on a copy first.
Average of ratings: Useful (1)