Installation's update

Installation's update

by Roberto Catanuto -
Number of replies: 10

Moodle 3.9.3

Hi I've to update my school's installation from 3.9.3 to 3.9.7.

I read in https://docs.moodle.org/311/en/Git_for_Administrators#Moodle_branch_names that all is needed is:

$ cd /path/to/your/moodle/

$ git pull

Is it the same for installed plugins?, e.g. :

$ cd mod/plugin_1

$ git pull

then

$ cd ../

$ cd mod/plugin_2

$ git pull


The git clone command has already been issued in the last upgrade from 3.5 to 3.9.3

Thank you.




Average of ratings: -
In reply to Roberto Catanuto

Re: Installation's update

by Ken Task -
Picture of Particularly helpful Moodlers

One can use git pull with addons *only if* ... *only if* ... the addon code was acquired via git repos for those addons.  Look for a hidden .git directory in those plugin directories.   If not there, plugin was not installed using git.

Other wise a git pull at code root of the moodle acquires *only* ... *only* ... core code.

To update the plugins either use Admin GUI interface for upgrading plugins via Moodle plugins server or manually acquire the zip files for the plugins and upgrade manually.

See: https://docs.moodle.org/311/en/Installing_plugins

'SoS', Ken

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

Re: Installation's update

by Roberto Catanuto -
Yes, the addons were installed via git. If I'm correct,
$ git fetch
$ git pull

would be enough.

For the core code, may you please let me know the git option to update from 3.9.3 to 3.9.7?

Thank you
In reply to Roberto Catanuto

Re: Installation's update

by Ken Task -
Picture of Particularly helpful Moodlers

@root of core code where one can see the hidden .git directory to update within a series ... like your 3.9.3 to what ever is the highest subversion (3.9.7) all that I have ever used is a 'git pull'.

@root of core code what do:

git branch -a

and

fgrep '$release' version.php

ls -l config.php version.php

show?

Plus ... to get from 3.5.x to 3.9.x what were the git commands you issued?

If part of a script, please share that part of your script here in text.

'SoS', Ken

In reply to Ken Task

Re: Installation's update

by Roberto Catanuto -
grep '$release' version.php
$release = '3.9.3+ (Build: 20201211)'; // Human-friendly version name

ls -l config.php version.php
-rw-r--r--. 1 testlmseveres479ch testlmseveres479ch 1019 Dec 14 2020 config.php
-rw-r--r--. 1 testlmseveres479ch testlmseveres479ch 1639 Dec 14 2020 version.php

the command issued to get from 3.5 to 3.9 were (in the core folder)
git fetch
git branch -a
git checkout MOODLE_39_STABLE

and it all went fine.
They were issued one at a time, no script used.
In reply to Roberto Catanuto

Re: Installation's update

by Ken Task -
Picture of Particularly helpful Moodlers

What was *'d (at the top of output) when issuing git branch -a

https://docs.moodle.org/311/en/Git_for_Administrators

Section Obtaining the code from Git
Shows a command before the checkout command (change version numbers when you issue since you are @ 3.9.x:

git branch --track MOODLE_311_STABLE origin/MOODLE_311_STABLE

Also see:
Updating your installation

See by response this is a test installation so the following won't hurt (one can always use a side load method to get the .git directory and hidden .gitx files back into current code directory).

Go into code root and re-issue:

git branch --track MOODLE_39_STABLE origin/MOODLE_39_STABLE

git checkout MOODLE_39_STABLE

Then ...

git reset --hard

Try the git pull again.

Then php admin/cli/upgrade.php

We're trying to bring site up to the highest of 3.9.x

3.9.7+ (Build: 20210511)

Before going any higher.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Roberto Catanuto

Re: Installation's update

by Roberto Catanuto -
The following commands
$git fetch
$git pull

worked for all plugins but one. It issues the following error:
~/coremoodle/lib/editor/atto/plugins/wiris$ git fetch
~/coremoodle/lib/editor/atto/plugins/wiris$ git pull
error: The following untracked working tree files would be overwritten by merge:
.eslintignore
.github/workflows/moodle-ci.yml
.vscode/extensions.json
CHANGES.md
TESTING.md
pix/logo-mathtype.png
pix/snapshot.png
tests/behat/atto_assignmentsGiveFeedback.feature
tests/behat/atto_pluginCompatibility_multilang2.featur_
tests/behat/atto_settingMathChemButtonEditorVisibility.feature
Please move or remove them before you can merge.
Aborting

It prevents me from updating the core moodle to 3.9.7, as I receive other errors when launching the update. Leaving them aside for now, but if they may be useful I'll post it all.
I also tried:
$ git reset --hard HEAD
HEAD is now at 7efe89b Feature removed

Thank you for any hints.
In reply to Roberto Catanuto

Re: Installation's update

by Ken Task -
Picture of Particularly helpful Moodlers

"The following untracked working tree files would be overwritten by merge"

Git does track all files of core code ... none of those you list are in my core 3.9.highest git installed and maintained site.

Well, you could do what it suggest:

"Please move or remove them before you can merge."  (make backup just in case)

But, I've never had to do that.

The plugin to which I see references is WIRIS ... isn't that commercial?

Check the hidden .git directory in wiris - config file ... that contain the URL it's going to in order to acquire an update.  Would imagine that a commercial plugin couldn't be updated forever and for free without some sort of payment!

You might have to do WIRIS manually.

'SoS', Ken


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

Re: Installation's update

by Roberto Catanuto -
Thanks Ken,
I had to manually "rm -rf" all the conflicting plugins, then "git clone -b stable" to all of them again.

After that I updated moodle to 3.9.7 correctly.
In reply to Roberto Catanuto

Re: Installation's update

by Roberto Catanuto -
As an update to this thread, I have to update to from 3.9.3+ 3.9.7 another Moodle site.
This time I do:
$ git fetch
$ git pull
error: Your local changes to the following files would be overwritten by merge:
admin/environment.xml
calendar/lib.php
course/lib.php
lang/en/moodle.php
lib/enrollib.php
lib/moodlelib.php
message/classes/helper.php
message/externallib.php
mod/lti/auth.php
version.php
Please, commit your changes or stash them before you can merge.
Aborting

This is different error from the other one.
Maybe you have already found this issue?

If I run
$ git checkout MOODLE_39_STABLE
...
...
Already on 'MOODLE_39_STABLE'
Your branch is behind 'origin/MOODLE_39_STABLE' by 25 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)

But git pull gives me the error above.
Thanks.
In reply to Roberto Catanuto

Re: Installation's update

by Ken Task -
Picture of Particularly helpful Moodlers

'Maybe you have already found this issue?'
No, I haven't.

From:
https://docs.moodle.org/311/en/Git_for_Administrators#Obtaining_the_code_from_Git

Read the comments about each command in the list.


git branch --track MOODLE_39_STABLE origin/MOODLE_39_STABLE
git checkout MOODLE_39_STABLE

To get this other site fixed, you might have to do a sideload and replace the .git directory in original code directory.

From:

https://stackoverflow.com/questions/14894768/in-git-how-is-fetch-different-than-pull-and-how-is-merge-different-than-rebase/14895578

"fetch will download any changes from the remote* branch, updating your repository data, but leaving your local* branch unchanged.

pull will perform a fetch and additionally merge the changes into your local branch
.

What's the difference? pull updates you local branch with changes from the pulled branch. A fetch does not advance your local branch."

'SoS', Ken

Average of ratings: Useful (1)