unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

by Paul Tibbitts -
Number of replies: 4

I had an installation of 2.1 moodle, which I was able to ugrade to 2.1.10.  Knowing that I can't update directly to 2.4.1, I upgraded to various 2.2.x releases without incident, but when attempting to upgrade to anything beyond 2.2.x (to 2.3.x or newer), I get an error that indicates that the database is still at 2.1.10:

Upgrading Moodle database from version 2.1.10 (Build: 20130114) (2011070110) to 2.4.1 (Build: 20130114) (2012120301)

The first check on the "checks" page fails, telling me I'm at 2.1.10 and need to be at 2.2. All the other show "ok."  I assume this means the db - not moodle, as it states - is at 2.1.10, since the code (fresh download from moodle.org) is most definitely beyond 2.1.x when I'm attempting the upgrade.

I'm stuck at this point.  It seems like the upgrades through 2.2.x from 2.1 don't require a db upgrade, but then the 2.3.x upgrades do.  But 2.3.x+ requires that you start with a 2.2.x database, which you won't have if you start at 2.1.10 and aren't required/able(?) to upgrade your database when you upgrade your code to 2.2.x.  Incidentally I have tried upgrading through multiple (admittedly not all) incremental releases along the way, but never hit the database upgrade issue/opportunity until 2.3.x - and then it's seemingly too late.

This is a cpanel linux server with apache.  I tried the initial upgrades with Installatron, but then reverted to doing them (from the original base 2.1) by downloading code direct from moodle.org.

Any suggestions will be appreciated.  Thanks.

Average of ratings: -
In reply to Paul Tibbitts

Re: unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

by Bret Miller -
Picture of Particularly helpful Moodlers

I generally use SSH and the CLI interface to upgrade, but after you install the code, you need to log in as a Moodle admin and visit the Notifications page to complete the database upgrade. I'm quite sure the 2.2.x requires a database upgrade from 2.1.x. 

If that doesn't kick off an upgrade, then either (1) it's not using your 2.2.x Moodle code, or (2) the database schema isn't right and it's time to check your schema against a clean install.

http://docs.moodle.org/22/en/Verify_Database_Schema

In reply to Bret Miller

Re: unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

by Paul Tibbitts -

Thanks for your reply.  My experience was that doing the upgrade from 2.1.1 all the way through 2.2.x didn't ask me to do a db upgrade.  By that I mean I could upgrade, go to the moodle domain name, and get a login page.  When I went to 2.3.x or 2.4.1, going to the domain name redirected me to /admin, and - without prompting for a login or password - told me a db upgrade was required.  It would let me, not having an admin password, proceed through the check page, where I got all OKs except for the moodle version.  Whether it would have let me actually do the db upgrade w/o knowing the admin password I don't know since I never got that last required OK.

Through 2.2.x I was ok doing the upgrade with Installatron.  After that, again just going to the customer's moodle domain name post-code-update, I'd get a warning that somebody (Installatron) had copied this new moodle on top of an older one, so I'd do the recommended moving the directory, copying in fresh code from moodle.org, etc.  And then get the db upgrade request by just visiting the customer's moodle domain name, again without knowing the admin password (the main moodle domain would redirect to /admin automatically, but not to a login prompt.)

Question: is it more practical to export the (3) courses from 2.1.x, make a fresh 2.4.1 install, and import them?  Would other data from the old db be required besides what the import would provide?  I've never exported/imported anything in moodle before, but would kind of like to get as clean a start as possible at 2.4.1.  Does the course import/export include all the required user account information, for example?  Or is it better to continue trying the code updates followed by trying to do the db verify/update manually?

In reply to Paul Tibbitts

Re: unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

by Bret Miller -
Picture of Particularly helpful Moodlers

I can't answer that as I have always upgraded by backing up custom files, deleting the site directory contents, extracting the new files, restoring custom files and running the upgrade earlier through the gui (until I got a timeout) now using the cli.

I know others on here have used the export/import method and prefer that approach. But for me, the upgrade method has been simpler and has consistently worked.

The database upgrade part though will only prompt a non-admin user to upgrade when there are critical changes that prevent logging into the site. Otherwise, you have to log in as an admin before it prompts to upgrade the database. I suspect that is the part that is missing from your 2.2.x upgrade.

In reply to Bret Miller

Re: unable to upgrade 2.1.10 -> 2.2.x -> 2.4.1

by Paul Tibbitts -

That's definitely important to know - that moodle has two different levels of notifiying when a db upgrade is (essentially) required.  I had no idea and just assumed that since I saw the notification upon just accessing the moodle url, it would always behave that way when an upgrade was needed - or even would be needed for future upgrades. It's very likely that that's what we were missing.  I've asked the customer if they want to retry the upgrade route knowing that, or if they want to try the export/import next.  In any case thanks again for your very helpful replies.