Score:1

Files migration from local dev site

kh flag

I'm migrating from Drupal 7 to Drupal 9 and am having an issue with my source files getting found with the upgrade_d7_file migration. My public files directory for my source site is not 'sites/default/files'. It's a multisite instance and it's public file directory is 'sites/example.com/files'. I have exported the configuration generated with migrate-upgrade --configure-only and can change the source_base_path value, then import it and see changes, but 'sites/default/files' gets added to the end of whatever I put into the source_base_path value. I do have my public files system path defined in 'admin/config/media/file-system' of the source site.

Is there a place to set the default path to start with something other than sites/default/files for the source site?

Added edit

I added $conf['file_public_path'] = 'sites/example.com/files'; to my settings.php file, but it was still not used. I then edited the exported migrate_plus.migration.upgrade_d7_file.yml file, but not the source_base_path. I added another constant underneath it "file_public_path: sites/example.com/files" then in the process section edited source_full_path's concat plugin section to

source_full_path:
  -
    plugin: concat
    delimiter: /
    source:
      - constants/source_base_path
      - constants/file_public_path
      - filename
  -

Then reimported the config. This worked, but it seems like a ridiculous workaround.

Thanks

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.