migrate_plus.migration.d7_allpublicfiles.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Every migration that references a file by Drupal 7 fid should specify this
  2. # migration as an optional dependency.
  3. id: d7_allpublicfiles
  4. label: Public files
  5. migration_group: d7_materio
  6. audit: true
  7. migration_tags:
  8. - Drupal 7
  9. - Content
  10. source:
  11. plugin: d7_file
  12. scheme: public
  13. constants:
  14. # The tool configuring this migration must set source_base_path. It
  15. # represents the fully qualified path relative to which URIs in the files
  16. # table are specified, and must end with a /. See source_full_path
  17. # configuration in this migration's process pipeline as an example.
  18. source_base_path: '../../d7.materio.com/public_html'
  19. process:
  20. # If you are using this file to build a custom migration consider removing
  21. # the fid field to allow incremental migrations.
  22. fid: fid
  23. filename: filename
  24. source_full_path:
  25. -
  26. plugin: concat
  27. delimiter: /
  28. source:
  29. - constants/source_base_path
  30. - filepath
  31. -
  32. plugin: urlencode
  33. uri:
  34. plugin: file_copy
  35. source:
  36. - '@source_full_path'
  37. - uri
  38. filemime: filemime
  39. # No need to migrate filesize, it is computed when file entities are saved.
  40. # filesize: filesize
  41. status: status
  42. # Drupal 7 didn't keep track of the file's creation or update time -- all it
  43. # had was the vague "timestamp" column. So we'll use it for both.
  44. created: timestamp
  45. changed: timestamp
  46. uid: uid
  47. destination:
  48. plugin: entity:file