Just thought of some other things I've had to set doing restores of courses for MySQL:
max_allowed_packet=500M
open_files_limit=6000
Besides having debugging on, check the contents of moodledata/temp/backup/. Moodle uses that directory to 'un-zip' backups.
0 byte .log files located there indicate successful restores of a course, but any .log files that are larger than 0 bytes might contain some clues. And there could be 'contenthash' named folders (bunch of letters numbers) that could contain what's left of an attempt to restore. You might find moodle_backup.xml (and other XML/folders there). Inspecting the contents might also give a clue. The moodle_backup.xml file is the 'roadmap' to the restore and must be present for the restore/backup process.
All the files/folders in moodledata/temp/backup/ are safe to remove manually if they are files/folders that were created by failed restore attempts.
'spirit of sharing', Ken