Backup of large course in Moodle 4.0 fails

Backup of large course in Moodle 4.0 fails

by Alain Raap -
Number of replies: 14
Picture of Particularly helpful Moodlers

I am testing our automated backup process for Moodle 4.0 on a Redhat 8 environment (Apache 2.4/PHP 7.4/Mariadb 10.3), and our largest course that normally runs 9 hours outside our Moodle cron fails to complete. I'm getting this error now:

== Performing backup... ==
!!! error/backup_controller_dbops_nonexisting !!!

The other courses end normally after the automated course backup has finished. 

Average of ratings: -
In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers
I found out that the record of the large course in the backup_controllers table is missing. It looks like that this large course gets in conflict with the automated backup cron script that runs the same backup script and in the same time slot. Probably the automated backup cleans up the backup_controllers table at the end?
In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers
Yesterday I tested a backup of another large course, this backup finished correctly. Only the time of the backup went from 1:10 hours (production) to 7:30 hours (Moodle 4.0). Anyone who has had the same experiences with Moodle 4.0 automated backups? Caching (Redis) is enabled on both environments, the difference is RHEL7 / PHP 7.2 (production) and RHEL8 / PHP 7.4 (Moodle 4.0).
In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi Alain,

Nice you already make tests with Moodle 4.0.

Apart from OS, are CPU/RAM/Disk type the same? With the same configurations/optimisations?

Séverin
In reply to Séverin Terrier

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers
Hi Severin,

Yes, both servers have the same configuration for CPU/RAM/Disk type and have the same optimizations.
I expected that Moodle 4.0 would be much faster on Redhat 8 for these kind of heavy tasks.
In reply to Séverin Terrier

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers
I made some progress on this subject, testing with Moodle 3.9 and Moodle 4.1 on a Redhat 8 environment. The Moodle 3.9 large backup finishes in the same time as on the Redhat 7 environment (works as expected). The Moodle 4.1 large backup still fails, a smaller backup file that takes 2,5 hours on Moodle 3.9, takes more than 6 hours on Moodle 4.1. So I think the backup process of the new Moodle version is much slower, we'll have to investigate what this will mean for the process time of our automated backup process that runs during the nigt. Anyone else who had problems with time consuming backups in Moodle 4.1?
In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Ken Task -
Picture of Particularly helpful Moodlers

Uhhhh ... typo?   4.1 hasn't been released yet. Still a dev+

$release  = '4.1dev+ (Build: 20221011)';

Uhhhh ... going after an 'earlybird' badge? smile

The latest supported 4.0 ia:

$release  = '4.0.4+ (Build: 20221011)'

'SoS', Ken


In reply to Ken Task

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers

Hi Ken,

Yes, not a typo😉and no, not an early badge needed😊

We’re just looking forward what to expect from the next LTS release 4.1 (in November I believe?)

But it’s a serious problem I discovered, and I think it must be somewhere in the new code (or maybe old courses that take a lot more time to backup)? Can’t get a finger behind it.

Maybe you can give it a try yourself?

In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Ken Task -
Picture of Particularly helpful Moodlers

Limited resources here so I'll have to wait to just prior to 4.1 release.

We've had this kinda discussion/cussion before.

For starters ... what is a large course?  Age of course? - when was it last reset? or is it a 'foreever course' ... #users, # quizzes, # videos/audios etc.   It's backing up just takes a long ... VERY LONG ... time to do so.   So what is the size of that backup file?

Then there is the standard stuff ... ok, we know Red Hat, but after that?

so on an so forth! smile

But ... press on! smile

'SoS', Ken


In reply to Ken Task

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers

Hi Ken,

The backups that cause the long time to run are very large courses (2GB) with a lot of users and quizes included. They are already used for a long time and because of the long time to run they were a reason to exclude them from the normal automated backup run. But now the largest course that ran 12 hours in Moodle 3.9, doesn't finish between the last and next automated backup anymore. 

The only difference in the environments is Redhat 7/Moodle 3.9/PHP 7.2 versus Redhat 8/Moodle 4.1/PHP 7.4.

In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, thinking outloud here ... cause I don''t have the resources to try out myself.

First a comment: I wouldn't consider a 2Gig course large ... but then again, am in the K12 world sooooooo.  I've several courses above that 2Gig - largest being 7.7 Gig.

Now outloud ...

auto used to take backup preferences - general backup defaults.
What are those? include logs, histories, calendar events, etc. - keep logs for X days
Actually, in 3.9, auto has settings of it's own:
and also in a 4.0.4+

Number of courses?

Your 4.1 isn't actively used so do you archive your 3.9 - restore to new environment - then upgrade to 4.1?   Then run auto?

adhoc task on the 3.9 look like?  ditto for your 4.1dev.

How long does that 2Gig course take to backup IF you were to backup just that course from cli?

'SoS', Ken


In reply to Ken Task

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers

Hi Ken,

The backup preferences are the same on 3.9 and 4.1, general logs and general histories are excluded from the backup.
The 2Gig backup takes 10 hours to complete, as I already mentioned it's a course that's already used for a long time
and with a lot of users and quizzes. Maybe it would better to create a new course and stop using these old courses

In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Ken Task -
Picture of Particularly helpful Moodlers

2Gig, to me, isn't a large course.

Suggestion if you have moosh installed ...

moosh has a course-info option. Takes only the course ID as a parameter.

Run like:

moosh -n course-info 342

will show the following ... * items might be of interest ...

Course ID: 342
No of contexts: 54
Context by level:
    CONTEXT_MODULE (70):    50
    CONTEXT_BLOCK (80):    4
Context by module:
    assign (1):    8
    folder (8):    20
    forum (9):    1
*    quiz (16):    8
    resource (17):    13
Number of role capability overwrites: 0
Role capability overwrites by context:
Number of local role assignments: 0
Locally assigned roles by context:
Number of enrolled users: 2
* Users enrolled by role:
    editingteacher (3):    2
Number of groups: 0
Group statistics:
    Min number of members in a group:    0
    Max number of members in a group:    0
    Avg number of members in a group:    0
Course modinfo size: 101830
Number of sections: 13
Section statistics:
    Sections visible:    12
    Sections hidden:    1
    Min number of modules in a section:    0
    Max number of modules in a section:    7
    Avg number of modules in a section:    3
Number of grades: 0
Number of log entries: 0
Number of files: 1234
* Total file size: 2277831177
Cache build time: 0.067739009857178

Dunno if moosh runs under a 4.1 dev however.

'SoS', Ken


In reply to Ken Task

Re: Backup of large course in Moodle 4.0 fails

by Alain Raap -
Picture of Particularly helpful Moodlers
Hi Ken,

We can't install/use Moosh on our servers, so I can't have a look at the course info. I think we'd better call it a day to find the cause.
I'm going to have a deeper look at Moodle 4.1, now preparing for PHP 8.
In reply to Alain Raap

Re: Backup of large course in Moodle 4.0 fails

by Ken Task -
Picture of Particularly helpful Moodlers

"can't install/use Moosh on our servers" ... really?

Mind expanding upon that?  Know you have commercially supported RedHat boxen ...

When it comes to moodle, I've always 'felt' one needed tools outside of Moodle alone to efficiently admin.

By all means you could 'call it a day' ... but curious minds would want to know! smile

'SoS', Ken