Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by mscag mscag -
Number of replies: 13
Hi,

I have installed Moodle using Git with the help of "https://docs.moodle.org/38/en/Step-by-step_Installation_Guide_for_Ubuntu" and everything is working as expected. After deciding to upgrade, things have started going absurd.

I was able to upgrade using the "git pull" command after putting the server into Maintenance mode, and the upgrade to 3.7.6. seemed to be successful according to the "/opt/moodle/version.php". However, according to the "Dashboard->SiteAdministration->Notifications" page, the version was still 3.7.5.

I tried changing the Branch from 3.7 to 3.8 and uprgade the system once again using "https://docs.moodle.org/38/en/Git_for_Administrators". I put the server into Maintenance mode, changed the Branch and completed the upgrade through CLI. Also confirmed this by checking "/opt/moodle/version.php". All fine. But the "Dashboard->SiteAdministration->Notifications" page, the version was still 3.7.5.

I even tried upgrading without Git with the help of "https://docs.moodle.org/38/en/Upgrading". I renamed the /opt/moodle folder and placed the up-to-date folder I downloaded as /opt/moodle. The system is up and running, but the "Dashboard->SiteAdministration->Notifications" page insists that the version is still 3.7.5.

The machine is on a virtualisation platform so I had the chance to revert back to the old situation with the help of Snapshots after every "upgade".

Any idea on what I am doing wrong ?

Regards.
Average of ratings: -
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What happened after you ran 'git pull'? Did you see all the upgrade stuff after you updated the code?
In reply to Howard Miller

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by mscag mscag -
The command upgraded the code successfully.
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Which command? 'git pull' isn't everything. Did you then run the Moodle upgrade?
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Ken Task -
Picture of Particularly helpful Moodlers

and the running of php upgrade.php --non-interactive

should have shown something. like

-->System
++ 2019052005.05: Success (0.01 seconds) ++
++ 2019052006: Success (0.01 seconds) ++
++ Success (0.85 seconds) ++
-->filter_mathjaxloader
++ 2019052001: Success (0.02 seconds) ++
++ Success (0.05 seconds) ++
-->gradereport_history
++ 2019052001: Success (0.01 seconds) ++
++ Success (0.04 seconds) ++
-->tool_usertours
++ 2019052001: Success (0.02 seconds) ++
++ Success (0.04 seconds) ++
== Setting new default values ==
Command line upgrade from 3.7.5 (Build: 20200309) (2019052005) to 3.7.6 (Build: 20200511) (2019052006) completed successfully.

fgrep '$release' version.php
$release  = '3.7.6 (Build: 20200511)'; // Human-friendly version name

Just did one ... 3 minutes ago.

'SoS', Ken

In reply to Ken Task

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by mscag mscag -
Hi,

Here is something interesting; I found that there are two different version.php files;
-rw-r--r-- 1 root root 1636 May 12 11:42 /opt/moodle/version.php
-rwxr-xr-x 1 root root 1636 May 12 11:44 /var/www/html/moodle/version.php

The git commands I executed earlier were all from the code folder "/opt/moodle", and the version.php file available there got updated also, but not the one in /var/www/html/moodle. Copying the "/opt/moodle/version.php" file to the "/var/www/html/moodle/" folder and modifying the permissions, allowed the Notification page to recognize the update, thus, update the DB. Now the Notification page shows the updated version as 3.8.3. All the files in the "/var/www/html/moodle/" folder are now old. Do they also need to be updated ?

Can you comment on the way I followed ? Was that the right thing to do ?

Regards.
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Ken Task -
Picture of Particularly helpful Moodlers

The git commands to upgrade a moodle have to be run from the code directory git is to update - where the hidden .git directory is located.

Is one code directory like  /opt/moodle an alias to the other /var/www/html/moodle or vice-versa?

Do both of your directories where code reside have a hidden .git directory?

Do you have a bash shell script outside of code directories that's supposed to cd /a directory first then execute various commands for your upgrade process?

In the /var/www/html/moodle/ directory run git pull again.  Does git acquire new files?   If one does that on a code directory that has already acquired git should inform.

'SoS', Ken

In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Either your Moodle lives in /opt/moodle or it lives in /var/www/html/moodle. I can't tell you - it's your system. However, the latter sounds more likely and as updating /opt/moodle didn't update your site I think that gives you a big clue.

You need to update *all* the files in the Moodle install using git. As (if I'm following you) you only copied the version.php you've got a bit of a problem. I hope you have a backup.
In reply to Howard Miller

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by mscag mscag -
Hi,

I just revised what I did during the installation. It seems that by following the "https://docs.moodle.org/38/en/Step-by-step_Installation_Guide_for_Ubuntu", I installed Moodle using Git on "/opt/moodle", and then copied the contents to "/var/www/html/moodle". Within the explanation on the page under the title "Step 5: Copy local repository to /var/www/html/", it says

############
Since we setup a local repository in the previous step, you will copy it to your webroot after any updates and making changes. Having your local repository outside of the webroot, like we have in /opt, you will be able to prepare and stage your upgrades in a more efficient manner
############

After reverting back from Snapshot, I successfully upgraded once again to 3.8.3 and copied the "/opt/moodle" folder to "/var/www/html/moodle". When I login to Moodle, however, I am forced to begin installation of a fresh Moodle by selecting the language.
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I suspect when you moved files from "/opt/moodle" folder to "/var/www/html/moodle" that you did NOT keep a copy of you config.php file in folder to "/var/www/html/moodle." Since the "new" code does not find the old config.php file, it starts a new install.

So my question is, what steps did you do to copy the contents from "/opt/moodle" to "/var/www/html/moodle?"

In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Ken Task -
Picture of Particularly helpful Moodlers

Are you a programmer?    The only reason I can see for doing git in /opt/moodle is if I were to modify core code ... run own repo.  Program.

Am not a programmer myself and use git only to update or upgrade core code.   So once I have git in a directory of /var/www/html/ ... like in /moodle/

I cd /var/www/html/moodle/ and without moving any files etc, run an 'up' script in that directory that backs up the moodle first and then runs cron ... puts site in maint mode, runs git pull, runs php admin/cli/upgrade.php --non-interactive check ownerships permissions site out of maint mode, purges cache.

Done! smile

'SoS', Ken

In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by mscag mscag -
Hi,

I was planning to start installing the server from beginning, keeping all the code/web content within "/var/www/html" this time, but thanks for all the comments, I then decided to give it one more try. It seems that it is OK to follow the steps below,

1. Upgrade code within "/opt/moodle" using Git, (and change the branch where necessary)
2. Rename "/var/www/html/moodle" to "/var/www/html/moodle.old.ver"
3. Copy the "/opt/moodle" folder to /var/www/html/moodle"
4. Copy "/var/www/html/moodle.old.ver/config.php" to "/var/www/html/moodle"
5. Update the plugins/themese within "/var/www/html/moodle/themes"
6. Follow the web interface to update the DB etc.
 
Regards
In reply to mscag mscag

Re: Notifications page insists on showing old version (3.7.5) after upgrade (to 3.7.6 or 3.8.2).

by Ken Task -
Picture of Particularly helpful Moodlers

Question for ya ... when you finish your process for upgrading,
what's missing?

Answer: any 3rd party *plugins* installed since your last update/upgrade.
In step 5 of your process, might re-consider ... some upgrades will change
theming completely.  Old themes no longer compat.  Web based upgrade stands a good chance to fail if you didn't research ahead of upgrade.

Sent you a PM here in Moodle ... please see.  Contains links to simple scripts.

'SoS', Ken