by Ken Task.
Random Glossaries could come from any Glossary in any course. IF I am reading the error correctly, there is no course '54' anymore thus the restore cannot find that data to use with the Random Glossary in the course you are trying to restore.
mysql> select fullname from mdl_course where id=54;
Would verify that.
If course exist, you'll see the course fullname. If the course doesn't exist, you'll see: Empty set (0.00 sec)
So to get around this ... when restoring from that backup file, step through each stage ... don't hyperjump to the end of the restore process. On what ever screen that shows the items to restore, *de-select* the Random Glossary block.
See if it restores.
'spirit of sharing', Ken