Git upgrade from /opt folder

Git upgrade from /opt folder

by Matt Lynch -
Number of replies: 3

Hi all,


I have followed this great resource:

https://docs.moodle.org/28/en/Step-by-step_Installation_Guide_for_Ubuntu#Step_6:_Setup_MySQL_Server

and I now want to upgrade my moodle install and I have a problem.

I think that I have to go into the /opt folder and use the 'git pull' command, and then I don't know how to move the new setup over to the old. I have moodle in the root directory and want it to stay that way.

Can anyone help?






Average of ratings: -
In reply to Matt Lynch

Re: Git upgrade from /opt folder

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Matt

If you followed those instructions accurately, specifically 'sudo git branch --track MOODLE_28_STABLE origin/MOODLE_28_STABLE' and 'sudo git checkout MOODLE_28_STABLE', all you need to do is 'sudo cd /something/moodle' and 'sudo git pull'. It will bring the 2.8.latest.

WARNING: Like in any other manipulation of this kind, you need to have a current backup of your data and the capability of restoring it in case something goes wrong!
In reply to Visvanath Ratnaweera

Re: Git upgrade from /opt folder

by Matt Lynch -

Thanks Visvanath,


I now realise I can update the moodle files in the /opt folder with git, but how do I move it over to my working moodle directory? Do i remove all of the files in my working moodle folder (which is the root folder) and copy them over? I don't think I want to overwrite them...

In reply to Matt Lynch

Re: Git upgrade from /opt folder

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Matt

I think the intermediate step over /opt in that tutorial https://docs.moodle.org/28/en/Step-by-step_Installation_Guide_for_Ubuntu (steps 4 and 5) is unfortunate. There is an explanation in Step 5, if I undertand it correctly, that is meant for people who change the Moodle code. My guess is that, if you have followed that tutorial accurately then the Git data, the .git/ directory, must have been copied to /var/www/moodle. So 'cd /var/www/moodle' and 'git pull' should work.

Reminder: No gurantee what so ever. You must be have a backup and the ability to restore it!