ERROR!!! The code you are using is OLDER than the version that made these databases!

ERROR!!! The code you are using is OLDER than the version that made these databases!

by Dinesh Raj -
Number of replies: 3

HI,

I cloned moodle from github and configured everything while the master branch was checked out ( admin sign up, adding courses etc). Now a day after I checked out MOODLE_32_STABLE and it says

"ERROR!!! The code you are using is OLDER than the version that made these databases!"

I did 'git pull' and it says "everything up-to-date". Any ideas?

Average of ratings: -
In reply to Dinesh Raj

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The error message is correct - the master branch is the latest development branch, which has a higher version number than the 3.2 stable branch.

There is no official way to move an installed version of Moodle to an earlier version. You *may* get away with editing the 'version' entry in the database table mdl_config, to match that in the 3.2 stable branch, then purge caches via admin/cli/purge_caches.php but that is not recommended. You would be far safer to start a fresh install using the stable code.


In reply to Davo Smith

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

by Dinesh Raj -
okay. But if I want to fix a bug for the stable 3.2 branch, how do I test my changes? Does this mean I have to install moodle again with the branch 3.2 checked out? Each branch requires a different version of the database? sad
In reply to Dinesh Raj

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

by Adrian Greeve -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers

A lot of us here at Moodle HQ have a separate directory for each moodle instance. If you are serious about fixing bugs in different versions then you should consider doing something similar. As mentioned above you could go into the config table and alter the version number to agree with version.php, but I wouldn't recommend that for jumping between different versions, only for minor version bumps, and never for production sites.