Restore failure - database error

Restore failure - database error

by alex sykes -
Number of replies: 5

I'm currently trying to move a course which is still under development from a production server to a development one. I have tried several backup and restore strategies but all end in failure.

The only data which I really need to transfer is the course content - as there are no users enrolled so far, I have tried backing up and restoring both with and without user data.

There is a database issue (error.txt) attached, which apparently is looking for a password and, when it gets null, aborts.

Any thoughts, please? Using 2.5.+ on both installations.

----

A little more... the issue appears to be related to a lesson activity. If I exclude the lesson from the restore, it appears to be working OK. Am still checking. Yes. Confirmed - Excluding lesson activity mends restore.

Average of ratings: -
In reply to alex sykes

Re: Restore failure - database error - Fixed, I think

by alex sykes -

The issue does appear to be related to the password field of the lesson table not being permitted to accept NULL.

Will post this to relevant Lesson forum.

In reply to alex sykes

Re: Restore failure - database error

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi alex,

I do not see this problem on my local moodle 2.5 test site. Using Moodle 2.5+ (Build: 20130606) and doing a backup/restore of a course with a Lesson with no password to a new course on the same server. Using mySql, Windows, PHP 5.3.

Have you tried a backup/restore of a course with a Lesson with no password to a new course on the same server, i.e. from your production to your production server?Ditto for a backup/restore of a course with a Lesson with no password to a new course on from your development to your development server?

Which system of database are you using on both servers?

Joseph

PS.- Since this does not concern the use of the Lesson activity as such I have taken the liberty to remove your post to the Lesson forum and suggest we continue discussion related to this problem on this Backup and restore forum.

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Restore failure - database error

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi again,

I've had another look at your error message and I see no reason why, in the data to be inserted to Lesson, the password field should contain a value of "NULL".

[array (
0 => 5,
1 => 'Bits, bytes and binary',
2 => '0',
3 => '0',
4 => '0',
5 => NULL,
6 => '0',
7 => 'O:8:"stdClass":3:{s:9:"timespent";i:0;s:9:"completed";i:0;s:15:"gradebetterthan";i:0;}',
8 => '100',
9 => '1',
10 => '0',
...

When I dump that data when doing a restore operation on my own test site, I get this when there is no password:

screenshot #1

Any idea how a "NULL" value got into your password field instead of leaving it empty?

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Restore failure - database error

by alex sykes -

Any idea how a "NULL" value got into your password field instead of leaving it empty?

I'm just wondering if this is never even intialised on Lesson creation. That would make sense - to me anyway...

In reply to Joseph Rézeau

Re: Restore failure - database error

by alex sykes -

Hi Joseph,

Thanks for your quick response. Yes, have tried the full range of options and each exhibits the same behaviour. I have also tried between courses ie. a new course on a secnd Moodle on the production server.

Production server is Linux - CPanel/WHM with MySQL 5.5.31 and PHP 5.3.22

Development server - Mac OS 10.8.4 PHP 5.3.15, MySQL 5.6.1---

In the end, I simply added a password to the lesson then went through the backup/restore again with no issues.

Thanks, also, for removing from the Lesson forum.