Error writing to Database trying to upgrade

Error writing to Database trying to upgrade

by Tanya Lasuk -
Number of replies: 5

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 sub 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 Tanya Lasuk

Re: Error writing to Database trying to upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Dial your php version back to a 5.6 or something less than 7.0.   Moodle 2.2.highest won't run under PHP 7.x.  The first version of Moodle where you can use PHP 7.0 is 3.0.highest.

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle in English: Re: Error writing to Database trying to upgrade

by Tanya Lasuk -
Yup tried that. The php errors went away but the database error was still there.



I’m wondering though whether I’m making a wrong assumption. I’m assuming the last version was 2.0 because someone labeled the directory moodle2
In reply to Tanya Lasuk

Re: Moodle in English: Re: Error writing to Database trying to upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Stupid question but after you dailed back to php 5.6.x, did you restart your web service?

Google search for similar errors points to php 7.0.x issues and code ... any code ... not just Moodles, me thinks.

So it appears you've move the contents of the moodle code up one level to the document root of web service/account - according to config.php file shared (uhhhh, you probably should obsecure the DB credentials next time ... even if pointed to localhost ... no use in providing more info that is really needed .... and no use making it a little bit easier for those who might try harm to your site.

Did you get all the files/subdirectories, including the hidden 'dot' files?

cd /path/to/moodle/code/

fgrep '$release' version.php says what?

which php

php -v

php -m

php -i

'spirit of sharing', Ken


In reply to Ken Task

Re: Re: Moodle in English: Re: Error writing to Database trying to upgrade

by Tanya Lasuk -
Thanks, Ken for watching my back. I did change the DB credential.



So it appears you've move the contents of the moodle code up one level to the document root of web service/account



Are you referring to the moodledata directory? the dataroot reference is unchanged since the previous version and the moodledata directory location is unchanged.



The zip file created the moodle directory in the root directory of this subdomain, so that’s where the wwwroot reference points..



Since this is a shared hosting system, I don’t believe I have control over restarting the web service. 



gosh thanks for the tip to looking the version.php. The previous version is NOT 2.0 which is what I suspected, it’s 2014111005.02 (2.8.5+)



This is good news and may be the key to the issues as I was trying to install 2.2 which would be backward.



Thank you also for the tip on the “dot" files. My  file manager exposes all file names including the dot ones - I find that more convenient.



I thought I was following instructions and putting all the code in a directory called  moodle-original. But perhaps the code that was already in the top directory should have stayed there.
In reply to Tanya Lasuk

Help getting back from maintenance mode

by Tanya Lasuk -

Well, I finally upgraded to 3.0 with a lot of dead ends. 


When I tried to take the site out of maintenance mode, I saw an error briefly that mentioned a JSON error when I clicked on the site administration menu item. 

I logged out and now there is just the maintenance mode message when I go to the site and there is no login on the page. 

Is there some way to undo the maintenance mode from the back end?