migrate_plus.migration.d7_allpublicfiles.yml 1.5 KB

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