How to fix the fatal error due to cached data while migrating?
Drupal uses code registry to load the files containing a class or an interface. While the code registry is cached in cache_bootstrap, it is contained in the registry and registry_file database tables.

To rebuild it, I would edit those database tables to change the path shown in the filename row to match the new site's path. Other methods that require bootstrapping Drupal would probably not work, since any class Drupal would use would not be found, causing a PHP exception, and stopping the bootstrap, with the effect that Drupal would not run the necessary code.