Upgrading from Moodle 3.1.2

Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Number of replies: 8

So here's my problem, I'm running Moodle 3.1.2 and the server host upgraded their PHP from 7.1 to a minimum of 7.3. Moodle 3.1.2 doesn't run on PHP 7.3. So now I get an error "Fatal error: Cannot use 'object' as class name as it is reserved public_html/moodle/lib/setuplib.php on line 66". So I have to upgrade Moodle. 

Which is the best way to do this so that I don't lose my course, my users and my theme. I'm worried that too large a jump in Moodle versions will cause problems. So should I go Moodle 3.7 on PHP 7.3.33 is that a safe jump, or do I go large and go 3.9 on PHP 7.4.27 (other option)?

Also the process, from what I've read, I backup and remove old files from Moodle directory, put in new files. Keep the moodledata directory as is. I copy back the config.php, the /mytheme directory, the /mymod directory. Then I try to run Moodle again. Moodle will detect the new version and do the database and file upgrades. Does this sound correct? What are the pitfalls?

Thanks, Mark

রেটিং এর গড়: -
In reply to Mark B

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি
Hi Mark,
Moodle 3.7 requires a minimum of Moodle 3.2 to upgrade from and 3.9 requires at least 3.5.

You could upgrade to 3.5 from 3.1, however it doesn't specifically mention PHP 7.3 as a supported version
3.6 does mention php 7.3 as a supported version (since Moodle 3.6.4), and 3.6 can be upgraded to from 3.1

so personally I'd probably try to go from 3.1 -> 3.6.latest as a stage one and then to 3.9.

process looks mostly right to me, although i'm not sure what the mytheme or mymod directories are, that doesn't sound like any moodle plugin paths I know.

I would backup both moodledata and the database before starting the upgrade, as to go back will require htem restoring them to how they were before the upgrade.


Some common pitfalls you can hit are the upgrade bailing halfway due to an error or bug in one of the plugins etc, or some new database index restriction being added where some data that already exists fails this restriction.

In general this is pretty rare, and you can take a copy of the moodledata/database locally and do the upgrade locally to test this process to get confidence that it is going to work smoothly on the production site.

Then after the main upgrade you usually want to audit your list of installed plugins and look for anything that you might want to remove that are no longer maintained or you are no longer using in active courses etc.
In reply to Francis Devine

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Thanks Francis, this is the link I'm using for a guideline: https://docs.moodle.org/311/en/Upgrading
It mentions the /theme/mytheme and mod/mymod directories.

The jump to 3.6 sounds good. I'll take notes and provide an update here on how it went.

Mark
In reply to Mark B

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি
I see, it looks like the "mytheme"/"mymod" options are placeholders for the example of if you have any custom plugins that you need to bring across from a 3.1 -> 3.9, so you would copy each plugin one by one from the old codebase to the new one.
In reply to Mark B

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Particularly helpful Moodlers এর ছবি

Before trying anything make a full site backup of code and DB ... that doesn't require a certain version of php nor is it done via Moodle.  Do a minimal backup of moodledata ... filedir only ... if space gets to be a problem.

Then download those backups to archive them off your current hosting situation.   Let me repeat ... download those backups off your current hosting!!!!

Consult this great resource:

http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

If one were to attempt hyperjumping you would have to go from 3.1.x (should at least be 3.1.highest) to the next long term support version of 3.5.x but, if you read the resource, 3.5.highest has a PHP 7.2 max.

Release notes for 3.5:

https://docs.moodle.org/35/en/Upgrading

As one marches forward with PHP, there are some new extensions also.

And, you've not mentioned your DB (flavor and version) ... that too might be a factor.

And another ... addon plugins and themes as one marches forward ... at some point in the 'march' those addon plugins and themes might no longer be compatible.

Kinda 'between a rock and a hard place'! :|

So ... what you might have to do, if hosting provider won't help with your Moodle march, is to find temporary hosting else where that would.

And one more question .... once you've made the site backup, how large are those ... the backup of your 3.1 code, the DB dump, and the full moodledata directory, please.

'SoS', Ken


In reply to Ken Task

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Thanks Ken, I have 3 backup files on my local computer now.

Moodle.zip 41K
Moodledata.zip 441K
Moodle.sql 32K

It looks like the MySQL is version 5.7

I also have access to another hosting account that goes back to PHP 7.1 if I need to get the current version working. Lots of learning to do over the next day or two.

I'll take notes and update here when I'm done, or if I get stuck.

Mark
In reply to Mark B

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
Particularly helpful Moodlers এর ছবি

moodle.zip ... 41K????!!!!

Are you sure?

https://download.moodle.org/releases/legacy/ 3.1.18 shows a 47.x Meg. zip!

And that's with no addons/etc ... just core code!

Make sure!!!!! হাসি

'SoS', Ken


In reply to Ken Task

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
My bad, those are all in MB

Moodle.zip 41 MB (on closer inspection it's 53 MB)
Moodledata.zip 441 MB
Moodle.sql 32 MB
In reply to Mark B

Re: Upgrading from Moodle 3.1.2

{$a->নাম} - {$a->তারিখ} দ্বারা
So updating this, trying to update the files to 3.6, while keeping moodledata and the dB the same didn't work for me. Same error. So installed the backup files (3 files, moodle, moodledata and dB) on a host that ran PHP 7.1. Worked great and was able to bring the site back as it was. I then backed up the course and users. Then on the original site running PHP 7.3 now, I installed a new version of Moodle (3.11) and imported the course and users. So I have two options now, I can keep the original host (where the website resides) running Moodle 3.11 on PHP 7.3 but I have to completely restyle the Moodle installation to look like it was OR I can keep Moodle 3.1 running on PHP 7.1 on the new host, styled the way I wanted, but then have to pay for two hosting accounts.