This process plugin was created due to a dodgy source repository. Not all the files were available and the default file_copy
plugin would crash and burn if the source was not there. This plugin can be used in the process section of a Drupal 8 migration like this;
source:
plugin: custom_file
scheme: public
constants:
source_base_path: 'https://example.com'
process:
source_full_path:
-
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
-
plugin: urlencode
uri:
-
plugin: skip_on_404
method: row
source:
- '@source_full_path'
- uri
-
plugin: file_copy
plugin: custom_file
scheme: public
constants:
source_base_path: 'https://example.com'
process:
source_full_path:
-
plugin: concat
delimiter: /
source:
- constants/source_base_path
- filepath
-
plugin: urlencode
uri:
-
plugin: skip_on_404
method: row
source:
- '@source_full_path'
- uri
-
plugin: file_copy
I really need to get my CSS sorted out for code blocks...
The plugin: