Mixed Moodle versions detected

Mixed Moodle versions detected

by Connie Hu -
Number of replies: 9

Hi -,

When i was upgrading moodle I got a message liek this:

'Mixed Moodle versions detected, upgrade can not continue.'

I am pretty sure that I only have a single version of Moodle there in the folder, I was just wondering what does Moodle use to decide whether it has got a only a single version or two versions?

I only have one config file there.

Thanks a lot!!!!!!!

Connie

Average of ratings: -
In reply to Connie Hu

Re: Mixed Moodle versions detected

by Ken Task -
Picture of Particularly helpful Moodlers

Config file is one thing ... version.php files are another.

If linux, logged on as user that can view files in your Moodle code directory, issue

fgrep release version.php

That will show something like:

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

In a 2.3.6+ version of Moodle there are several version.php files

Issue the following at same location:

find ./* -name version.php

That will list all subdirectories that contain a version.php file.

One example in moodlecode/user/profile/field/checkbox/:

fgrep version ./user/profile/field/checkbox/version.php

$plugin->version   = 2012061700;        // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires  = 2012061700;        // Requires this Moodle version

So the error you are getting might mean just what it says ... mixed versions ... or files from old versions of moodle still remaining in the  2.3.6+ directory of folders/files.

'spirit of sharing', Ken

 

In reply to Ken Task

Re: Mixed Moodle versions detected

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Ken,
the message is not caused by files called "version.php", so I'm afraid it won't help Connie to search for those files.

Connie,
although you are "pretty sure" you only have a single version of Moodle, I'm afraid your Moodle scripts folder contains files leftover from an earlier version of Moodle. It is those files that cause the message to be displayed. It doesn't matter what those files are. The important point is that you have tried to upgrade to a new major version of Moodle by simply overwriting the old Moodle scripts folder with a new version of Moodle. While that is OK for minor upgrades (e.g. 2.4.1 -> 2.4.2), it causes problems for major upgrades (e.g. 2.3 -> 2.4).

Please follow the instructions that appear later in the message that tell you how to create a new Moodle folder and copy across any thrid party plugins that you might be using.

good luck!
Gordon

In reply to Gordon Bateson

Re: Mixed Moodle versions detected

by Connie Hu -

Hi Thanks Gordon,

I fixed it by removing the 'Search' folder under the moodle directory.

not sure yet if this would cause any problems though.....

I am on testing server so I will try various things out....

Connie

In reply to Gordon Bateson

Re: Mixed Moodle versions detected

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

Can I suggest that it isn't ok - period. There's no reason to copy the new version on top of the old. You only have to rename/copy/delete the old version.

The OP, in this case, "fixed it" by removing the search folder. However, evidence strongly suggests that the upgrade was done wrongly and there could be trouble in the future. The right thing to do is completely replace the Moodle code with a clean version.

In reply to Howard Miller

Re: Mixed Moodle versions detected

by Luis de Vasconcelos -

Yes, it's so simple! Assuming Moodle is installed in \Moodle:

  1. Stop IIS/Apache
  2. Rename your existing Moodle folder to e.g.: \MoodleOld
  3. Create a new \Moodle folder
  4. Put the new version of Moodle in that new \Moodle folder
  5. Make sure the new \Moodle folder has the same permissions as the old one
  6. Start IIS/Apache
  7. Upgrade Moodle

 

In reply to Luis de Vasconcelos

Re: Mixed Moodle versions detected

by Joey Barclay -

I have tried everything I have seen on these old posts to try and resolve my issue. I have the same problem of the "Mixed Moodle versions" error page and I have tried to do the rename of old moodle folder create new one upload and unzip new version, etc... Nothing has worked. First problem is I am running Linux on a VPS using the Plesk panel hosted by GoDaddy. I am not able to access the server and run any command line utilities as they do not allow SSH. Their isn't even a Moodle folder, it is called httpdocs but even after that realization and renaming that to old and creating new httpdocs with new version of Moodle and copying over config.php, moodledata it still doesn't work. I also looked for the "search" folder to remove it, as a temp workaround, and I cannot even find a folder called "search" anywhere in httpdocs or even my moodledata folder. 

PHP version is 5.4 and I was trying to install 2.8. Obviously the error is a result of PHP scripts of different versions. (FYI: I hired someone to do this for me who had experience and he up and quit and I have been learning from the beginning as I have never has experience with Moodle prior to this. 

Anyway, I was finally was getting the "Session Handler is Misconfigured" error. Cleared local cookies and cache in two different browsers and then I got a blank screen so I thought I was closer but to try and resolve that I removed the "Cache" and localcache" folders from moodledata and now I am back to getting the session handler is misconfigured and no cookie or cache removal will do anything now. Seriously stuck in nowhere ville... Any assistance from anyone would be fantastic.

In reply to Ken Task

Re: Mixed Moodle versions detected

by Connie Hu -

Thanks Ken,

I removed the 'Search' folder under the moodle directory and fixed it.... not sure it would have any other problems yet... will try ....

Connie

In reply to Connie Hu

Re: Mixed Moodle versions detected

by Alex Walker -

For anyone who sees this on upgrading, Moodle checks for the presence of old files before it upgrades. Here's a list of the files it checks for.

This list obviously may change in the future. You can find the list in lib/upgradelib.php. Search for 'someexamplesofremovedfiles'.

Note: this is the list of 'old files' from Moodle 2.4. If you're using an older version, don't delete these files, because you'll still be using them and things will break. Horribly.

  • /admin/tool/unittest/simpletestlib.php
  • /lib/minify/builder/
  • /lib/yui/3.4.1pr1/
  • /search/cron_php5.php
  • /course/report/log/indexlive.php
  • /admin/report/backups/index.php
  • /admin/generator.php
  • /lib/yui/2.8.0r4/
  • /blocks/admin/block_admin.php
  • /blocks/admin_tree/block_admin_tree.php

It's worth noting that this list doesn't mean "screw Moodle's upgrade protection, I'm just going to overwrite Moodle and remove these files" (I'm not aiming this at you, Connie, I'm just saying in general). That protection is in place for a reason, and you'll probably have lots of little issues if you don't upgrade properly. For example, course reports moved from /course/report to /report between 2.2 and 2.4, and if you leave the old files where they are, you'll get every course report showing twice in the navigation block and half of them won't work.

Average of ratings: Useful (1)