Do i need write access to the files directory to migrate d7_file? I'm migrating a site from drupal 7 to 8.  It has many many media files.  Something like 6TB worth.  And adding daily.  So i want to do the db migration on my machine (not the webserver), work out kinks and modify custom code to work w/ d8, then do the real thing on the live machine over a slow weekend when i have all the steps worked out.
In the migration process, i've gotten to drush migrate-upgrade d7_node, and it (on initial run, with only a token few files in /sites/default/files) created a handful of db entries in file_managed.  So i sshfs mounted the live files directory read only from my machine and re-ran migrate-upgrade d7_node from the restored db.  Now it doesn't create anything in the file_managed table, so i suspect it's not working, but it gives no errors, and some grepping doesn't readily yield the code that does this work.  I wouldn't mind hacking for this part only.
Hence the question.  And what can i do alternatively to avoid copying 6TB of files for the preparatory migration?
Thanks.
Ok, i figured this one out.  The magic lines are in /core/modules/migrate/src/Plugin/migrate/process/FileCopy.php
First, make sure source_base_path is correct in your config: Check drush mmsg d7_file after migrate-upgrade d7_node --limit=1 to see whether it is correctly finding the files.  Use drush config:export and config:import to modify it til that works.  Alter settings.php to put config/sync somewhere other than /sites/default/files
Second, mount the live site's public files dir read-only at /sites/default/files.
Third, modify /core/modules/migrate/src/Plugin/migrate/process/FileCopy.php around line 149 to comment out the action.  Make it look like this:
    if (!is_dir($dir) || !is_writable($dir)) {
      if (!$this-&gt;fileSystem-&gt;prepareDirectory($dir, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS)) {
        throw new MigrateException(&quot;Could not create or write to directory '$dir'&quot;);
      }
    }

    $final_destination = $this-&gt;writeFile($source, $destination, $this-&gt;configuration['file_exists']);
    if ($final_destination) {
      return $final_destination;
    }
*/
      return $destination;```


Last, run drush migrate-upgrade d7_file

Enjoy.