Upgrade to 3.5 via git offers 3.6

Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -
Number of replies: 8

Greetings,

Problem I have is, that once I run upgrade.php script from admin/cli, script warns me, that I'm upgrading to 3.6DEV version (which I dont want) and thats it is in alpha state.

Steps I took to try to upgrade my latest 3.4 version to 3.5 version:

1. mkdir /var/www/moodle_35

2. cd /var/www/moodle_35

3. git clone git://git.moodle.org/moodle.git

4. cd moodle

5. git checkout -b origin/MOODLE_35_STABLE

6. git pull origin/MOODLE_35_STABLE (or git pull origin MOODLE_35_STABLE) (or git pull origin origin/MOODLE_35_STABLE) -> yes, three different tries

7. cp -a /var/www/moodle_35/moodle/. /var/www/html/

8. sudo /usr/bin/php admin/cli/upgrade.php


And after this command, I get warning about aplha dev version of upgrade.


I have also tried following https://docs.moodle.org/34/en/Git_for_Administrators in section Obtaining the code from git and then copying the files to my "site" and running upgrade script with same result..

Average of ratings: -
In reply to Anze Pratnemer

Re: Upgrade to 3.5 via git offers 3.6

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You are not upgrading, you are installing!

Upgrade just needs,
$ cd /var/www/html/moodle
$ git pull

Then either
$ /usr/bin/php admin/cli/upgrade.php
or visit your site as 'admin' and go to Notifications.

P.S. I used the neutral $ as prompt. The sudo thing may or may not be necessary, depending on your distribution. A more readable version will result if you do
$ su -
OR
$ sudo -i
before all that.

P.S. The secret behind 3.6 is that just minutes ago 3.5 was released, making the latest 3.6dev+!!
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -

If I do that (didnt know that with cp you also clone git, i never inited or cloned git into this dir, just copied all the files and folders from other gitted dir..) it says I need to specify with which branch to merge.


COmmand is git pull <remote> <branch>


What is remote and branch param in my case?

In reply to Anze Pratnemer

Re: Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -

Ahh, got it, it was:

sudo git pull git://git.moodle.org/moodle.git MOODLE_35_STABLE


But now I'm getting hundreds of conflicts..


I was told, that I could pull into different folder and simply copy all the pulled newer files over older ones and then run upgrade script..

In reply to Anze Pratnemer

Re: Upgrade to 3.5 via git offers 3.6

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
OK. If you have a copy of a directory, which was cloned using git, then you just do 'git pull' inside the directory - that's all. It will give you the latest of the branch you were in.
Ref. https://docs.moodle.org/34/en/Git_for_Administrators#Updating_your_installation

Note that you have fixed the branch you want to follow with a command like 'git branch --track MOODLE_XY_STABLE origin/MOODLE_XY_STABLE'.
Ref. https://docs.moodle.org/34/en/Git_for_Administrators#Obtaining_the_code_from_Git

If you want to change the branch, you issue the same command with the new XY.

To make sure that you have the correct version/release go through the content of the file "version.php" at the top level.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -

More insight: if I run git status in /var/www/moodle_35/moodle

I get:

On branch origin/MOODLE_35_STABLE

nothing to commit, working directory clean


Which makes me think, that files in this directory are version 3.5.


Why doesn upgrade script then recognize them as 3.6DEV?


In reply to Anze Pratnemer

Re: Upgrade to 3.5 via git offers 3.6

by Ken Task -
Picture of Particularly helpful Moodlers

Think you need to re-read the git pages ....

IF you use -b in the first git command, think you are restricting git to a single branch ... whatever you have pointed to supposedly.   That bites when you are at say 3.4 and want to upgrade to 3.5.

Here's my git clip

git clone git://git.moodle.org/moodle.git [nameofdir]

[nameofdir] will be created ... whatever you name it ... elearn, learning, lrn, lms, whatever.

cd [nameofdir]
git branch -a

The branch being tracked at this point is the dev branch.

below replace the # to desired version ...

git branch --track MOODLE_3#_STABLE origin/MOODLE_3#_STABLE
git checkout MOODLE_3#_STABLE

now look at the tracking - to get 3.5 stable replace # above with 5

git branch -a

is the * on 35?  if not, you did something wrong.

check the version.php file

fgrep '$release' version.php

should see the following for 34.

$release  = '3.4.2+ (Build: 20180427)'; // Human-friendly version name

for 35

$release  = '3.5 (Build: 20180517)'; // Human-friendly version name

'spirit of sharing', Ken


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

Re: Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -

Thank you for detailed debugging.


If i run git branch -a I get following:

 master

* origin/MOODLE_35_STABLE

  remotes/origin/HEAD -> origin/master

  remotes/origin/MOODLE_13_STABLE

  remotes/origin/MOODLE_14_STABLE

  remotes/origin/MOODLE_15_STABLE

  remotes/origin/MOODLE_16_STABLE

  remotes/origin/MOODLE_17_STABLE

  remotes/origin/MOODLE_18_STABLE

  remotes/origin/MOODLE_19_STABLE

  remotes/origin/MOODLE_20_STABLE

  remotes/origin/MOODLE_21_STABLE

  remotes/origin/MOODLE_22_STABLE

  remotes/origin/MOODLE_23_STABLE

  remotes/origin/MOODLE_24_STABLE

  remotes/origin/MOODLE_25_STABLE

  remotes/origin/MOODLE_26_STABLE

  remotes/origin/MOODLE_27_STABLE

  remotes/origin/MOODLE_28_STABLE

  remotes/origin/MOODLE_29_STABLE

  remotes/origin/MOODLE_30_STABLE

  remotes/origin/MOODLE_31_STABLE

  remotes/origin/MOODLE_32_STABLE

  remotes/origin/MOODLE_33_STABLE

  remotes/origin/MOODLE_34_STABLE

  remotes/origin/MOODLE_35_STABLE

  remotes/origin/master

with * on the 3.5 version i guess..


with fgrep i get: $release  = '3.6dev (Build: 20180521)'; // Human-friendly version name

I have tried to rebuild the git (deleting folder and redoing everything) and result is the same.


sad

In reply to Ken Task

Re: Upgrade to 3.5 via git offers 3.6

by Anze Pratnemer -

Hmm, for some unknown reason, I had to restart ubuntu for git commands to start working from a scratch..


fgrep now shows correct version, I'll try updating moodle now.


Thank you very much for you help!