Course restore stuck?

Course restore stuck?

by Uwe Klemm -
Number of replies: 2

Hi,

we encounter the following problem: On our Moodle (3.8.2+) we want to import and restore courses from another instance. Those courses are created with a Moodle 3.6, the .mbz are reasonably small (5.5MB) and just have standard activities. Our Moodle has asynchronous restore enabled.
I can upload them and start restore, everything seems oK. But then, you just see that restore is in progress and nothing ever happens, even after hours. Cron works oK. Just to be safe, I also triggered cron manually, this doesn't make any difference. There is no error message. Debugging doesn't produce any error message either. The course as such (empty) is created, but the actual contents never appear....
Strange thing, too: In the "restore" window, the course name does not appear in the progress field. Just to be safe, I also tried to restore a course that has been saved inside our Moodle - same result.
We've restored courses successfully before, so this is new.
I also don't find a way to actually stop a restore that is shown as in progress - there does not seem to be a function like this in the administration menus?
Any help is greatly appreciated.

Uwe

Average of ratings: Useful (1)
In reply to Uwe Klemm

Re: Course restore stuck?

by Ken Task -
Picture of Particularly helpful Moodlers

With new features there *sometimes* new 'bugs' which haven't resolved nor reported yet.  Might ... notice I said might ... be an issue of cron jobs and clean up task.  Backup/Restore in progress and cron job/task to clean up cleans up a backup/restore in progress.

admin/settings.php?section=tool_recyclebin

Enable course recyclebin yes, but item lifetime set to 60 minutes/1 hour.
Enable category rcyclebin yes, but course lifetime set to 60 minutes/1 hour.
Turn off (uncheck) Auto hide.  Recycle bin link will always appear enabling
the 'immediate' election ... which is really just moving to moodledata/trashddir
sooner where it will remain for default 4 days.

/admin/settings.php?section=asyncgeneralsettings
enable async backups ... turn off.
Asynchronous backups and restores allow users to do other operations while a backup or restore is in progress.

Doesn't allow one then to navigate away from a course backup/restore.
Must wait until completed.

Inspect moodledata/temp/backup/ for backups or restores that have failed.
hints ... a contenthash directory - a failed/nonreported backup/restore will not have a moodle_backup.xml file present and no new files are being added.  There is no 'backup.mbz' file which hasn't been renamed and *copied* to destination which is a backup preference ... might consider setting so that all backups go to a designated directory outside of the sea of files in moodledata/filedir/

Can see filenames/dates then without having to make DB queries to find the meta data for contenthash which is the location of the .mbx in moodledata/filedir/.

One can manually remove contenthash directories safely IF after inspecting it appears contents are not being used ... date/time stamps on files a clue.

In course/management.php one can see references to 'Restore in progress' and you can delete them.  Remember that increases recyclebin held data.
In Admin menu Category menu ... Recyclebin link should be present.
Accessing that one can delete.
Have to do that per category.

** STAY ** on screen where its shows progress ... do NOT navigate away from it to do something else ... let it finish ... which is old behavior but one should be able to see (hopefully) any major errors.

There is a difference between import and restore.
Import is for inserting content from a backup that was made **from the same server** ... not your 3.6 backups.

'SoS', Ken

In reply to Ken Task

Re: Course restore stuck?

by Uwe Klemm -
Ken - you're the best. Thanks a bunch - this worked beautifully. Restore worked like charm.
Wish I could buy you a pint smile
Thank you, Uwe