Automatic update to Moodle 3.1.3 didn't work

Automatic update to Moodle 3.1.3 didn't work

by Matthias Giger -
Number of replies: 7
Picture of Particularly helpful Moodlers
I'm using Moodle on a hosted server with automatic updates.


Unfortunatelly the update from Moodle 3.1.2 to 3.1.3 didn't work.

As an administrator I get the following message:

"Mixed Moodle versions detected, upgrade cannot continue"

Is there a way I can fix this by running a "magic" script? 


Or at least, where do I get a zip file with the Moodle 3.1.2 code to bring the folder back to the pre-update state? On the download webpage I can only find the latest release.

Average of ratings: -
In reply to Matthias Giger

Re: Automatic update to Moodle 3.1.3 didn't work

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The only way to go back is to restore from a backup.  You will have to restore your moodle folder, database and moodledata folder from prior to the upgrade attempt.

You would be better off to take a fresh copy of the 3.1.3 code, copy over any plugins and the config.php file from your existing moodle code and have the new folder take the place of your old folder.  (Name the old folder moodleold etc and then name the new one moodle or whatever your codebase folder is called).  Do NOT copy over the existing folder as this will cause the situation you are in now.

One more reason to not use the built in installers!

In reply to Emma Richardson

Re: Automatic update to Moodle 3.1.3 didn't work

by Matthias Giger -
Picture of Particularly helpful Moodlers
Thank you for you reply.


I tried to install the new version directly but had a warning about the version of the database:
version 5.5.31 is required and you are running > 5.5.5.10.0.27
So I didn't proceed to update the database.

My problem at the moment now is that I use many plugins so installing them by hand will be quite a task. Is it possible to reinstall the plugins later without loosing activities connected to them? Or do I really have to upload all the plugins by hand?

At the moment, I'm really not sure how to proceed. Should I ask my provider to restore the whole system to a point before the update?

In reply to Matthias Giger

Re: Automatic update to Moodle 3.1.3 didn't work

by Ken Task -
Picture of Particularly helpful Moodlers

Ask provider ... yes.   At this point, safest.   They shouldn't mind as their 'autoupdate' script apparently didn't work. :\

This question, however, remains .... the DB version requirement should have been there with the 3.1.2 code you had.  Don't think I've ever seen Moodle change DB requirements within a series (like 3.1.x).   Higher DB requirements usually occur when going upwards to the next version ... like  from 3.1 to 3.2 - which is an upgrade not an update.

Might also be a good time to check all your plugins for compatibility and updates.   Unfortunately Moodle doesn't provide a tool inside Moodle code to do that.   Must use https://moodle.org/plugins/ and set the moodle version to that which you have at present (once restored by provider).

And, this should also be a learning experience ... always ... always ... make a full site backup consisting of code directory, database dump, and to be sure, the moodledata directory.

Also, before upgrading, check:

https://download.moodle.org/releases/latest/

https://download.moodle.org/releases/security/

The links above will show DB requirements.

'spirit of sharing', Ken



In reply to Ken Task

Re: Automatic update to Moodle 3.1.3 didn't work

by Matthias Giger -
Picture of Particularly helpful Moodlers

Thank your for your advise Ken.

Actually, the installation started as a 3.0 installation and then was "automatically" (or whatever the provider did) updated to 3.1. (to 3.1.2) without any obvious problems (notifications). The problem only struck with the 3.1.3 update.

In the meantime the system is working again with minimal loss - the provider played the daily backup in. Considering the advise and looking back at the experience, I've switched of the "automatic update" feature.

In reply to Matthias Giger

Re: Automatic update to Moodle 3.1.3 didn't work

by Ken Task -
Picture of Particularly helpful Moodlers

Glad to hear you're working again ... minimal loss (sigh!).

Mind sharing which provider has this 'automatic update' available?

Most providers point to the community forums here for resolution of problems but there a some situations where none here could help.    Your provider might be one of those.


Thanks, in advance, Ken


In reply to Matthias Giger

Re: Automatic update to Moodle 3.1.3 didn't work

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It's the "automatic updates" thing that worries me.  Unfortunately, we have no clue what these scripts are doing. If your host provides this script then they should really help you out if it doesn't work. 

If you have added lots of optional plugins their data will stay in the database even if the code for the plugin isn't in the upgraded version of Moodle. If/when you add the plugin again the old data should magically appear (and upgrade if need be). 

In reply to Howard Miller

Re: Automatic update to Moodle 3.1.3 didn't work

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I also find the reference to "automatic updates" a concern. If the people who create Moodle have not created a way of automatically updating the code then I would want to know much more about a 3rd parties scripts for automatic updates. To create such scripts is certainly possible, but not trivial.