I received several reports of failure when restoring 1.9 backups under Moodle 2.4 with questions containing images or files.
I am able to reproduce the problem myself.
The problem is windows specific and caused by paths containing a mixture of slashs and backslashs.
Since MDL-33424 has been implemented in Moodle 2.3.6 and Moodle 2.4.3 files embedded into questions are no more restored as legacy files and migrate_file is called. On windows sometime an exception is thrown:
Debug info:
Error code: file_invalid_path
$a contents: [tempdir]/backup/648d042d6bc9cc26bf912dc81bf94c6c/course_files\bullet-1.gif
Stack trace:
line 1216 of \backup\converter\moodle1\lib.php: moodle1_convert_exception thrown
line 1309 of \backup\converter\moodle1\lib.php: call to moodle1_file_manager->migrate_file()
to solve this problem I think that all that is necessary is to backport Petr's commit a629ad3dff36554755796c9fbb790db4a02824c4 MDL-37780 fix 1.9 restore on windows.
If this is agreed I can prepare the git branches.
Thanks a lot for considering this.
- Discovered while testing
-
MDL-40140 Developer debug when previewing a restored quiz.
- Closed
- has been marked as being related by
-
MDL-37780 Windows specific unit test failures
- Closed
-
MDL-33424 Images missing when restoring a course (V1.9) or a course / quiz (V2)
- Closed
- will help resolve
-
MDL-37879 Import backup course from 1.9.x to 2.3.4+ course no longer works
- Closed