Unable to Restore A Course

Unable to Restore A Course

by Bill McNutt -
Number of replies: 2

I'm starting a new thread because I've changed my environment so much:

I'm running Moodle 2.6.1+ (Build: 20140117).  It's on a Windows 2008 R2 Server running IIS7

PHP Version 5.5.8

I am running MSSQL Server 2008 R2 10.40.1617 on a Windows Server 2008 R2 server.  The SQL server has a four moodle servers running on it (each with a separate database).  It has 24 GB of RAM an .99 TB free on the data drive (out of 1.28 TB available).  The OS drive has 30 GB free of 80GB available.

I need to be able to reproduce courses.  The procedure as described is to backup the course, and then restore.  The backup process runs just fine, but the restore never completes.  It restores the course partially, successfully creating the course, but does not populate it past the first topic. 

Oh, and I have done a backup of the course with only the introduction.  Total size: 78K

Still doesn't restore.  The browser just spins until timeout.

Can anybody help me?

Average of ratings: -
In reply to Bill McNutt

Re: Unable to Restore A Course

by Florent Picard -

Hi Bill:

Have you read the following material concerning Installing MSSQL for PHP for Moodle 2.4:

http://docs.moodle.org/24/en/Installing_MSSQL_for_PHP

In particular, the the default character set for databases is utf8 and database collation is something like Latin1_General_CS_AS

I imagine that, if thoses values are not respected in MsSql database when the backup of a course is created, because the database has not those values by default, the restoring process might be long when the computer tries to match two types of collation or characters sets that don't perfectly match; the fact can be that the default values used to create the backup file are not those default values looked for at the moment of restoring process and the is a mismatch the computer tries eternally to solve.

The query command to convert the database to utf8 is: ALTER DATABASE mydatabasename charset=utf8;

Good luck.

Florent Picard.

In reply to Bill McNutt

Re: Unable to Restore A Course

by Bill McNutt -

My problem is resolved. 

I am uncertain where my problem was, as I modified two things at once.  First, I changed my sql drivers.

I changed over to FreeTDS version 0.91.93.  (This one: http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip)

Note that this requires a freetds.conf file in the root of your C: drive, something that makes me cringe, but at this point I was seriously in "don't touch any defaults that you don't have to" mode.

Because the 64-bit NTS version of PHP was still "experimental," I have used 32-bit PHP on my 64-bit system.  So I used the 32-bit FreeTDS sql driver with it.

At the same time, I noticed that my PHP manager was reporting that   PHP_FCGI_MAX_REQUESTS setting in my php.ini file was set at 200.  The suggested value was 12000.  That's not a typo.  It had defaulted to 200, and given my other settings the PHP manager suggested TWELVE THOUSAND. 

I approved the change, restarted IIS, and two weeks of angry frustration went away like a soap bubble in a cactus factory run by hedgehogs.

I think all that business with drivers was unnecessary.  I think that the course I was trying to restore was sufficiently complex that I was running out of PHP_FCGI requests, so it just sat there and waited until it timed out.