Error writing to Database trying to upgrade

Error writing to Database trying to upgrade

by Preet kaur -
Number of replies: 2

I'm trying to upgrade Moodle from 2.0 to the latest version on a shared server.

After reading the documentation I saw that I needed to upgrade through 2.2 and 3.0 before getting to 3.4.2

php 7.0 and mariaDB with InnoDB already in place. 

so upgraded to 2.2 and got this error

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; filterobject has a deprecated constructor in /home/sravasti/public_html/safe-sravastiabbey.org/lib/filterlib.php on line 424

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tabobject has a deprecated constructor in /home/sravasti/public_html/safe-sravastiabbey.org/lib/weblib.php on line 2504


Error writing to Database 

I am not the original manager of this site and don't know anything about Moodle other than reading the documentation.  This was dropped in my lap after the original volunteer quit. I run a WP site that has this Moodle app as a Lyrics domain.


these are the only two files I copied into the directory from the old version which is in a directory in the main directory - following the instructions for upgrading to 2.2.


Average of ratings: -
In reply to Preet kaur

Re: Error writing to Database trying to upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle 2.2 will not work with PHP 7.0!

You need to upgrade PHP in step with Moodle.  I think you should be ok with PHP 5.6. 

PHP 7.0 was not supported until the later versions of Moodle 3.0. PHP 7 is *required* from Moodle 3.4.

You also need to be careful about the MySQL version. Earlier versions of Moodle are unlikely to work with 5.7 or newer. 

In reply to Preet kaur

Re: Error writing to Database trying to upgrade

by Usman Asar -
Picture of Plugin developers Picture of Testers
Although Howard already mentioned the main culprit being PHP 7, so switch to 5.6, then start upgrading, 2.0 > 2.2 > 2.7 (this is important as to upgrade to 3.x, you need to have 2.7 at minimum), then to 3.0.
if you manage to upgrade to 3.0.1+ then PHP 7 can be used (prefer 7.0.x version and not 7.1 or later).

This step wise up gradation will let you bypass the REQUIREMENT of Barracuda as file format in MySQL, else quick jumps will require it and on shared host you wont be able to convert file formats. make sure your DB language is set to UTF8_unicode
Average of ratings: Useful (1)