You also could use the "course_restored" event what will be fired after finishing the restore. Then you could use the given courseid to check whether your temp table exists or not. The temp table could use the courseid in its name to find it. The name must be unique just in your db session.
General developer forum
Anyone using after_restore_module hook?
This discussion has been locked so you can no longer reply to it.