Upgrading old moodle on old server

Upgrading old moodle on old server

by Aurélie Merckx -
Number of replies: 9

Hi everyone,

I've inherited an old Moodle website, which has been running well so far but hasn't been maintained much.
It's using Moodle 3.8 running on Ubuntu 18.04.4.
PHP version is 7.1.33-15 and MySQL version is 5.7.30-0.

I understood that the best (less risky) option would be to migrate to a new server running a fresh and up to date distribution of Ubuntu. However I have questions:
- is it correct that it's easier and less risky to change servers rather than do a release-upgrade?
- which version of Ubuntu would be recommended: 22.04 Jammy Jellyfish or 24.04 Noble Numbat ?
- the PHP and MySQL versions will be different. Should I upgrade Moodle before migrating servers or after? Does it have an impact?

Many thanks in advance for your help and support!

Average of ratings: -
In reply to Aurélie Merckx

Re: Upgrading old moodle on old server

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You have lot of freedom in choosing all that. And this time it'll be easier than the first time, Upgrading an old version of Moodle.
wink

I've documented the hard facts in a chart: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases. (Pay attention to the maximum compatible versions of system software.)

Average of ratings:Useful (1)
In reply to Aurélie Merckx

Re: Upgrading old moodle on old server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In case you don't read any further... make sure you take full backups of Moodle before you touch anything.

I would strongly recommend migrating to a new server. Release-upgrade will almost certainly work in that it'll upgrade Ubuntu. The most likely outcome, however, is that it will trash your database. Not the end of the world (if you have a backup) but a hassle.

I just like the idea of knowing that I have a completely clean server and then re-installing my Moodle data. If we're talking Ubuntu Server then always go with the LTS. I think that's currently 22.04
 
BUT... you also need to consider what Visvanath is saying above ^^
In reply to Howard Miller

Re: Upgrading old moodle on old server

by Jon Witts -
Picture of Plugin developers Picture of Testers
Ubuntu 24.04 is the latest LTS release - I never install a production server until it is at least on the .1 release... It will probably be at some point this summer that Ubuntu 24.04.1 is available

Jon
Average of ratings:Useful (1)
In reply to Aurélie Merckx

Re: Upgrading old moodle on old server

by Ken Task -
Picture of Particularly helpful Moodlers

In addition to Mr. V's and Howard's advice ... both semi repeated here ...

Lot's of planning ahead.
Highest version of 3.8 is 3.8.9 (Build: 20210510)

If you plan to march the site upwards, first order of business is to do a full
site backup and store on server.  That's code + DB dump + minimally moodledata/filedir/

Before doing anything with the site, set the theme to boost via config.php file
and leave it like that for the duration of the march.
$CFG->theme='boost';
You can worry about how site looks after arriving at destination version .. for the march concentrate on function ... not form.

Get the 3.8 site under git versioning ... side load or upload ... and get to the 3.8 to highest.
One reason for doing that ... scripts in admin/cli/ .. one of which is uninstall_plugins.php
which will help you ID additional plugins installed in the current site.

Git makes marching much easier ... just for core moodle.

I'd also highly recommend the installation of moosh - command line utility for Moodle.
A version compatible with version of 3.8.
https://moodle.org/plugins/pluginversions.php?id=522
0.39 (2021032400)

Note: you will have to upgrade moosh as well.

Plan the march checking Mr. V's chart and Moodle releases IO
https://moodledev.io/general/releases
making note of required PHP version, MySQL/MariaDB version + php extensions.
You can't get those higher than what is supported moodle version wise.

Now some questions:
How are you hosted?   
Does hosting offer attached data devices that you can detach and re-attach to another server?
How are users currently authenticated?
Does site make use of any external resources that would require re-config at the other end?

There is an alternative to a site march.  Individual full course backups.
XFer those to a file system repo on new server.  Restore using moosh or scripts in admin/cli/

Catch 22 for that approach - add-on plugins in current site .. do they exist in destination version?

Lot's of planning and fun and games ahead! smile

Hope your 'customer' doesn't expect this to happen in a short time frame!

'SoS', Ken

In reply to Ken Task

Re: Upgrading old moodle on old server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would add that if the site matters at all... I would get a working copy and do a test run somewhere where it doesn't matter if/when it goes wrong.
Average of ratings:Useful (1)
In reply to Ken Task

Re: Upgrading old moodle on old server

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up to own posting just to keep it together ... just thought of one additional - worth doing now.

Install MySQLTuner - a .pl script - run with superuser creds of DB server.

You might find there are tables in need of optimizing and other tweaks you could do now to make your DB best it can be ... knowing that when finally having to upgrade MySQL ... at least the DB for moodle is as good as it can be.

And ... DB character set and collation ... InnoDB, utf8mb4 character set with utf8mb4_unicode_ci collation - matches what is in config.php of site.

There are a couple of cli only scripts in code/admin/cli/ that will check and fix - if need of fixing, fix them now .. before you begin.

On new server make sure tuner is also installed - run it there as well  After every hop moodle version wise.

Last 2 cents worth!

'SoS', Ken

In reply to Aurélie Merckx

Re: Upgrading old moodle on old server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I believe that you have already asked this kind of question. See Upgrading an old version of Moodle.
 
In reply to Rick Jerz

Re: Upgrading old moodle on old server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ooft... if the OP had got on with this 4 years ago, their life would have been so much easier now sad