Ubuntu 16.04 to 18.04 upgrade

Ubuntu 16.04 to 18.04 upgrade

by Daniel Martin -
Number of replies: 10

Is there documentation that someone knows of that list what needs adjusted for Moodle when upgrading Ubuntu?


We are using Ubuntu 16.04.16, Apache 2.4.18, MySQL 5.7.33, PHP 7.0.33

We tried upgrading to Ubuntu 18.04 which updates Apache to 2.4.29, MySQL to 5.7.33, and PHP to 7.2

We are on Moodle 3.5.17, MySQL is using UTF8 instead of UTF8MB4 (we didn't know if this needs updated first)


After the update we get a "refused to connect" error in the browser.

Our goal is to upgrade to Moodle 3.9


Thank you


Average of ratings: -
In reply to Daniel Martin

Re: Ubuntu 16.04 to 18.04 upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

The 'in place' upgrade to Ubuntu is really outside the scope of these forums, but if one googles one might find 'differences in opinions/experiences'.

Make sure you have a full site backup of the moodle (code + sql dump + moodledata) archived OFF the server in case your 'in place' upgrade has serious issues!

The DB being fully compliant DB wise can be accomplished via cli only php scripts in admin/cli/

mysql_collation.php, mysql_compressed_rows.php, mysql_engine.php

They all have 'help' if issued with no parameters.

I no long have a 3.5.x, but did convert the db for moodles that have been marched/upgraded to be compliant for destination version at that time ... a 3.9.highest.

In your current setup, go to Site Admin, Server, Environment - update component.   Screens there will have what you need and when you need it when it comes to DB compliance.

Also see:

https://docs.moodle.org/310/en/MySQL_full_unicode_support

There are some settings that are best set/can only be set in config file for the DB server.

'SoS', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Ubuntu 16.04 to 18.04 upgrade

by Matt T -
I'll elaborate on what Ken probably wants to say. smile

I actively discourage using in-place upgrades for any server, Windows or Linux. A clean install of the new operating system has a lot going for it, in my view. Particularly on Linux, in-place upgrades work OK for an untouched server. The moment you change system configuration you introduce scope for instability. Granted, Canonical have made inroads here, but they're nowhere near as good at Microsoft. 

I think there's a real likelihood it will take longer to fix the resulting dependency problems than to actually reconfigure a new server. I also think it's just nice to periodically refresh the server using the latest baseline configuration as a starting point.

OP, in your context, I would say that installing a new Ubuntu 20.04 LTS distribution would be quite sensible. You will then have around four to five years of Canonical support, with fairly recent PHP packages in the default repositories and newer system packages, including a later Linux kernel.

Just my 2 cents.
In reply to Daniel Martin

Re: Ubuntu 16.04 to 18.04 upgrade

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Moodle rel. 3.5 runs on PHP 7.0 as well as on 7.2 https://docs.moodle.org/dev/Moodle_3.5_release_notes#Server_requirements. It is possible that the dist-upgrade did not bring back all the PHP modules required by Moodle. You could try to install a new Moodle 3.5 test site in the same server. Otherwise the usual culprits are stale caches. Try purging cache on the server and the client. On the server side, since Moodle is not running, you'll have to run '/path/to/php /path/to/moodle/admin/cli/purge_caches.php'.

The URL of the site did not change, right?

Did you check whether a test.html file can be accessed by visiting yoursite/test.html, and the standard phpinfo.php file with the single liner '<?php phpinfo(); ?>' gives you the expected PHP info page?
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Ubuntu 16.04 to 18.04 upgrade

by Daniel Martin -
Thank you Ken and Visvanath. Still exploring but this has been helpful. As this is a DEV site with VM snapshots we can try and try again smile
In reply to Daniel Martin

Re: Ubuntu 16.04 to 18.04 upgrade

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
When you upgrade a Ubuntu server and get a new version of PHP you will need to reinstall all of your PHP modules too - there are different versions of the modules for each version of PHP.

I would agree with others though; that installing a fresh Ubuntu 20.04 server would be the best way to go and then migrate your Moodle install to the new server. If you are using VMs for your servers then this should not be too much of an issue.
In reply to Jon Witts

Re: Ubuntu 16.04 to 18.04 upgrade

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I can't say much about Ubuntu. On Debian dist-upgrades are very reliable. Out of the dozens I remember, only once I broke the system and had to re-install. Once I marched a system over three releases, from Debian 6 "Squeeze" to 9 "Stretch". Only thing, you can't skip a release. Just the other day installed Debian 6 "Squeeze", EOL Febraury 2016, anew and still getting packages from the archives.

I must say that there is a strong Debian faction in our local Linux User Group. We consult each other - preferably before taking a dangerous step.
wink
In reply to Visvanath Ratnaweera

Re: Ubuntu 16.04 to 18.04 upgrade

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The Ubuntu dist upgrades themselves are pretty stable... I have done it a few times (often on my dev machine) as I prefer to go for a fresh server install with production and migrate everything across. The main issue I have seen with dist upgrades is that whilst you get the new versions of PHP and Apache installed, you may not get all of the modules bought across too. This has lead to a bit of head scratching in the past, but I have come to expect it now!
Average of ratings: Useful (1)
In reply to Daniel Martin

Re: Ubuntu 16.04 to 18.04 upgrade

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I have found that during any php upgrade, you then have to go in and remove the old version of php.
In reply to Emma Richardson

Re: Ubuntu 16.04 to 18.04 upgrade

by Daniel Martin -
Thanks for all the support. We decided to start over with a new Moodle 3.9 instance.