Upgrading Moodle 3.8 to 4.3 (feat. PHP 7.4 to 8.1, and dealing with problem plugins)

preview_player
Показать описание
Lots of stuff in this video. I upgrade a Moodle from 3.8 to 4.3 using git. Along the way a PHP version upgrade was also necessary, so I go through upgrading PHP from the Sury repository (No total OS upgrade necessary - though it is also a good option.

This time, I'm working with a booby trapped Moodle. i encounter numerous problems along the way and go through how to fix them. One problem very surprisingly sorts itself out...

0:40 - Initial Moodle setup
1:40 - Checking Environment variables
2:40 - Checking PHP and Moodle versions
3:25 - About PHP end-of-life versions
4:13 - Other things to consider (my additional plugins)
6:00 - Planning the next move
7:05 - Logging in and changing to the Moodle directory
7:15 - Making sure we're fully updated on the current branch (3.8.x)
8:25 - Putting the Moodle into maintenance mode
9:45 - Reminder to Take backups - don't try this at home (or anywhere else) without backups!
10:21 - Checking that all my plugins are also up-to-date
10:57 - Checking for updates on the Notifications page

11:29 - 1st upgrade 3.8.9 ▶ 3.11.18 (on PHP7.4)
13:27 - Checking for the updates on 3.11
13:45 - Checking for plugin updates for the new Moodle version (3.11)
15:10 - A note on updating sites with many plugins installed
15:33 - Planning the next upgrade step (to 4.0 - Checking the environment again)

16:31 - 2nd upgrade 3.11.18 ▶ 4.0.12 (still on PHP7.4)
18:37 - Checking for plugin updates for the new Moodle version (4.0)
19:28 - After updating plugins, the default settings screen (with a required setting)

20:44 - 3rd upgrade 4.0.12 ▶ 4.1.8 (still on PHP7.4) (I sing the praises of git yet again here)
21:42 - Checking the environment again for 4.1
21:53 - Checking the environment again for 4.2 (and one more reason why git is awesome)
22:40 - Realizing I can't move to Moodle 4.2 without first upgrading PHP
22:55 - Googling how to upgrade PHP (and what steps we need to do)

25:40 - Upgrading PHP - Step 1: Adding the Sury repository
26:55 - Upgrading PHP - Step 2: Update package info (apt update) to get info from the newly added Sury repo
27:38 - Upgrading PHP - Step 3: Installing a new PHP version (PHP8.1)
29:16 - Upgrading PHP - Step 4: Setting Nginx to use php8.1-fpm instead of php7.4-fpm
32:08 - Upgrading PHP - Step 5: Changing the CLI PHP default version

33:50 - Checking for plugin updates for the new Moodle version (4.1)
34:19 - Hitting the max_input_vars problem (fpm edition)
35:40 - Fixing the max_input_vars problem (php-fpm). And some other tweaks.
39:30 - Stopping the now unused php7.4-fpm service (masking not uninstalling)

40:35 - Planning the next upgrade step (tp 4.3 - Checking the environment/plugins again)
41:25 - Attempted 4th upgrade 4.1.8 ▶ 4.3.2 (on PHP8.1) (I sing the praises of git yet again here)
42:02 - OMG a plugin got borked... (featuring debugging messages that weren't actually part of the video plan)
42:30 - Using git to go back to 4.1 after a failed upgrade to 4.3 (Did I mention that git is awesome?)
46:10 - Uninstalling the problematic plugin (yeah this was also bumpier than I expected... #EditingIsTooMuchWork)
46:55 - Removing the plugin by hand (using force!)
48:35 - That plugin really wants to stay...
52:15 - Finish arguing with topcoll and try upgrading to 4.3 again

52:25 - Hitting the max_input_vars problem (cli edition)
52:43 - Fixing the max_input_vars problem (php-cli)

55:11 - 4th upgrade 4.1.8 ▶ 4.3.2 (on PHP8.1) Success!
55:50 - Just a quick note about the Cron message on the Notifications page
56:30 - Checking on plugins and having an unexpected success
57:51 - Purging caches after a lot of upgrades... Preventing the "clash of the caches"

Some commands used
Install a new PHP version for Moodle
sudo apt install php8.1-{pgsql,mysql,curl,xml,xmlrpc,intl,soap,gd,mbstring,yaml,zip,fpm}

Switch CLI version to use newly installed PHP
sudo update-alternatives --set php /usr/bin/php8.1

Links to resources viewed at the beginning of the video
Рекомендации по теме
Комментарии
Автор

Hi Wisecat! Thanks so much for this video. I learned a lot, particularly the steps on upgrading PHP properly! Much appreciated.

Timbit-gkvp
Автор

You're amazing person!! Thanks a lot for your help. 🤗

NayadeFranco
Автор

Hi WiseCat, thank you for the video. I have a little question. Where can i find the folder "vagrant.wisecat", (min 31:20) i know it is your domain but, with someone who install it in localhost or public ip from Azure. I'm looking that folder to change the PHP version that are moodle using. Thank you for your help!

Panchoclooo
Автор

Super useful video! Many thanks.
To be honest, my limited knowledge of servers and Moodle precludes me from following the command line approach. I always use the manual FTP route of renaming the existing Moodle directory on the server and uploading the new version of Moodle and copying across the config.php file, etc. Then I download and upload the up-to-date plug-ins and theme.
My current version is Moodle 3.10.4 (Build: 20210510) and I want to update to version Moodle 4.3.3+ (Build: 20240308). I guess even manually I'll need a two-stage update?

johnleggett
Автор

Hi WiseCat, thank for your video. Can you explain how to upgrade Moodle in a Docker environment?

christianw.
Автор

Thanks for this video!! Greetings from argentina

karimhallar
Автор

Hi Wisecat, i have a comlicatied one i could use your guidence with.
i have an old Winodws 7 IIS machine currently running php 5.4 and Moodle 3.1
i need to get to the end target of latest php and moodle on a linux server.

but its so old Curl doesnt work on the windows machine. so i cant view the upgrade paths either.

Any suggestions

Korallis
Автор

Hi Sir, I Have question, When deciding to upgrade from Moodle version 3.xx, what is the best choice for the version we choose? do we upgrade to the latest version or the LTS version? thx u

arisawidi