migrate_plus.migration.d7_allpublicfiles.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. - Materio
  11. - Files
  12. source:
  13. plugin: d7_pubic_file
  14. scheme: public
  15. constants:
  16. # The tool configuring this migration must set source_base_path. It
  17. # represents the fully qualified path relative to which URIs in the files
  18. # table are specified, and must end with a /. See source_full_path
  19. # configuration in this migration's process pipeline as an example.
  20. source_base_path: '../../../d7.materio.com/public_html'
  21. process:
  22. # If you are using this file to build a custom migration consider removing
  23. # the fid field to allow incremental migrations.
  24. # fid: fid
  25. filename: filename
  26. source_full_path:
  27. -
  28. plugin: concat
  29. delimiter: /
  30. source:
  31. - constants/source_base_path
  32. - filepath
  33. -
  34. plugin: urlencode
  35. uri:
  36. plugin: file_copy
  37. source:
  38. - '@source_full_path'
  39. - uri
  40. filemime: filemime
  41. # No need to migrate filesize, it is computed when file entities are saved.
  42. # filesize: filesize
  43. status: status
  44. # Drupal 7 didn't keep track of the file's creation or update time -- all it
  45. # had was the vague "timestamp" column. So we'll use it for both.
  46. created: timestamp
  47. changed: timestamp
  48. uid: uid
  49. destination:
  50. plugin: entity:file