Unable to Perform Backups in Moodle 2.5

Unable to Perform Backups in Moodle 2.5

by Douglas Ullman -
Number of replies: 8

Hello all,

I'm very new to Moodle Administration, and am having a bit of difficulty troubleshooting a problem I'm having. Whenever I attempt to perform a backup of a course after upgrading to 2.5, I get a Server500 error. I've turned on debugging, but it does not throw any errors.

I have checked my plugins and they appear to be up to date. I've checked the timeout settings in the PHP.ini file.

I ultimately am trying to import from one course to another, but when that failed, I attempted to just backup, with no resolution. I'm not sure what my next steps would be. Any suggestions are welcome!

 

Thanks!

Average of ratings: -
In reply to Douglas Ullman

Re: Unable to Perform Backups in Moodle 2.5

by Ken Task -
Picture of Particularly helpful Moodlers

Error 500's are kinda a general catch all and not very descriptive of the problem.  And you've not given anyone much to go on ... server local, remotely hosted and shared (provider), locally hosted in a virtual environment, or locally hosted as a stand alone ... operating system, etc..

But ... check permissions on the moodledata/temp folder.  It is there that Moodle must be able to access a folder called 'backup'.  The web server user must be able to create folders/files in that directory.

Check for existence of that folder and it's contents.  Anything?

Could temp files be created in the operating system temp folder?

Since it's an upgrade ... upgrade from what?

'spirit of sharing', Ken

In reply to Ken Task

Re: Unable to Perform Backups in Moodle 2.5

by Douglas Ullman -

Ken, 

Thank you for the reply. I've seen scouring through the forums on here for different fixes, you have a lot of experience and insight. 

To your questions. I inherited the environment, so I'm still finding my way around. This is my first job in the Educational environment, and my first run in with Moodle. If I'm leaving anything lacking, please let me know. 

It's a locally hosted server. Currently running 2008R2 Virtual Server in a 2008 R2 Hyper-V environment. IIS7, PHP 5.3.10, and SQL2008. This environment was limping along and crashing a lot. Recent upgrade was 3 steps. 

1.) Moving from a SQL server also running in a HyperV session, to a 2008 Cluster running SQL Enterprise.

2.) Allocating 16GB of Memory and 4 processing cores to the Moodle server.

3.) Upgraded from 2.2 to 2.5.

Checking permissions. What user needs access to that directory? Right now, I have Creator Owner, System, Administrators, Users, and DefaultAppPool. Right now, IIS is configured to have IUSR to run Moodle. Is this the user that needs rights? Or is there a Moodle user that needs them instead? In so far as what's in the Temp/Backup directory, there are couple files and a directory matching one of our classes. But unfortunately not the one I'm trying to work with. It appears the cron job is trying to perform backups? 

At this point, I have 0 confidence in any backup that has run on this system. All the log files point to backups being skipped. I can not backup nor import any class. I know the SQL side is backing up fine, but from that I gather, that's about 1/2 of what I actually need to protect. 

I'm figuring that if I solve the "Can I back this class up?" problem, it will solve the "Can I import this class?" problem. Is that assumption correct? 

 

Looking at the mdl_backup_controllers table, there are 3350 rows, 2789 in mdl_backup_courses. Something definitely seems to be amiss.

 

In reply to Douglas Ullman

Re: Unable to Perform Backups in Moodle 2.5

by Ken Task -
Picture of Particularly helpful Moodlers

Unfortunately (for you) ALL of my experience and 'insight' is on the Linux platform - ie not Windows.  Gave that up with NT 4.0 vs RedHat Fedora years ago.

But, from what you say ... 'This environment was limping along and crashing a lot' maybe (if you are game and have the resources) it's time to switch to Linux! ;) 

I know that doesn't help.  Guess I've just start the discussion and drawn out some details so that persons with experience and insight into that kinda set up can help you (specifically).

How about it Windows folks?

'spirit of sharing', Ken

In reply to Ken Task

Re: Unable to Perform Backups in Moodle 2.5

by panagiotis karageorgos -

I seem to have the same problem backing up large files.

As i can see large for my system means about 150M. 

I have been following many forums for a week or so that i m trying to solve this problem.

From what i ve read i made some changes to php.ini 

These are:

upload_max_filesize = 300M

max_execution_time = 3600

upload_max_filesize = 300M

My system is an Ubuntu 12.04 32bit, 

PHP Version 5.3.10-1ubuntu3.9, 

version 5.1.33 mysql, 2G RAM

Moodle 2.3.6 stable

The most common error when backing up a large file is "INTERNAL SERVER ERROR" and if i change debug to on it does not give me any clue in html screen.

After refreshing the page from "INTERNAL SERVER ERROR" gives me a "error/cannot_finish_ui_if_not_setting_ui"

Also automated backups after having "unfinished" in some courses gives an "error" in next try.

Any help will be appreciated,

Thank you

 

In reply to panagiotis karageorgos

Re: Unable to Perform Backups in Moodle 2.5

by Calvin Bu -

This work for me.

in PHP.INI

max_execution_time = 600

In IIS 7.5, double click on FastCGI Setting icon, edit the php-cgi.exe and change the "Activity Timeout" to 600.

In reply to Douglas Ullman

Re: Unable to Perform Backups in Moodle 2.5

by Douglas Ullman -

Looking further into this, the 2.5 doc says to:

  • Delete old records from "backup_ids" table: Check the table exists, repair it and try again.
  • Delete old records from "backup_files" table: Check the table exists, repair it and try again.

However, those tables do not exist in my Moodle database. There is a backup_ids_template and backup_files_template. Otherwise, I found the mdl_files table mentioned in this thread: https://moodle.org/mod/forum/discuss.php?d=224252

I ran: select * from mdl_files where "component" like 'backup' 

It returned 2813 rows. 

Running theory for a fix would be to clear out the backup files listed above in the mdl_files table, and clear out the mdl_backup_controllers tables? Has anyone done that before? Is that a terrible idea?

In reply to Douglas Ullman

Re: Unable to Perform Backups in Moodle 2.5

by John Pembroke -

Hi Douglas

 

Did you solve this error.

 

I have a similar issues, Moodle 2.5, IIS 7.5, Fast CGI on Hyper V, MSSQL DB non virtualised. I recieved a 500 error anytime I have a process that exceeds 60 seconds. Reloading/refreshing a number of times normally allows the process to complete. Not ideal.

 

I cheked all settings in php.ini, fastcgi and IIS to allow for greater times than 60 seconds. I am starting to feel that it is a Hyper V issue. Have you used any particular settings on your Hyper V enviorment to assist here.

 

In reply to Douglas Ullman

Re: Unable to Perform Backups in Moodle 2.5

by Larry Elchuck -

A bit of a discovery on my particular generation of this error "cannot_finish_ui_if_not_setting_ui"

 

I have the topcoll format installed and the mdl_format_topcoll_settings table was not present (as I updated to Moodle 2.6 from 2.3)

 

Sometimes the "mdl_format_topcoll_settings table missing" error was generated with debugging turned on; sometimes the error "cannot_finish_ui_if_not_setting_ui" occurred when trying to backup a course.

 

I created a new table in the database using the following and my backups work fine now.

 

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `mdl_format_topcoll_settings`
-- ----------------------------
DROP TABLE IF EXISTS `mdl_format_topcoll_settings`;
CREATE TABLE `mdl_format_topcoll_settings` (
    `id` bigint(10) NOT NULL AUTO_INCREMENT,
    `courseid` bigint(10) NOT NULL,
    `layoutelement` tinyint(2) NOT NULL DEFAULT '1',
    `layoutstructure` tinyint(1) NOT NULL DEFAULT '1',
    `layoutcolumns` tinyint(1) NOT NULL DEFAULT '1',
    `tgfgcolour` varchar(6) NOT NULL DEFAULT '000000',
    `tgbgcolour` varchar(6) NOT NULL DEFAULT 'e2e2f2',
    `tgbghvrcolour` varchar(6) NOT NULL DEFAULT 'eeeeff',
    PRIMARY KEY (`id`)
) ENGINE=`InnoDB` AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ROW_FORMAT=COMPACT COMMENT='States the settings used with the given course.' CHECKSUM=0 DELAY_KEY_WRITE=0;

SET FOREIGN_KEY_CHECKS = 1;

If using topcoll format in your course(s), check to see if the table exists, and if not, create the table, then try your backup!

Attachment backup-after.jpg
Attachment backup-before.jpg