d6_file.yml

Same filename in other branches
  1. 9 core/modules/file/migrations/d6_file.yml
  2. 8.9.x core/modules/file/migrations/d6_file.yml
  3. 11.x core/modules/file/migrations/d6_file.yml
core/modules/file/migrations/d6_file.yml

File

core/modules/file/migrations/d6_file.yml

View source
  1. # Every migration that references a file by Drupal 6 fid should specify this
  2. # migration as an optional dependency.
  3. id: d6_file
  4. label: Public files
  5. audit: true
  6. migration_tags:
  7. - Drupal 6
  8. - Content
  9. source:
  10. plugin: d6_file
  11. constants:
  12. # The tool configuring this migration must set source_base_path. It
  13. # represents the fully qualified path relative to which URIs in the files
  14. # table are specified. This can be a local file directory containing the
  15. # source site, e.g. /var/www/docroot, or the site address,
  16. # e.g. https://example.com. This value will be concatenated with the file
  17. # path (typically sites/default/files) and used as the source location for
  18. # the files.
  19. #
  20. # Suppose that the source files have been moved by other means to a location
  21. # on the destination site.
  22. # Source site:
  23. # Location of files: /var/www/html/legacy/sites/default/files
  24. # Public scheme: sites/default/files
  25. # In this example, source_base_path should be '/var/www/html/legacy'.
  26. #
  27. # Suppose that the source site is a multisite installation at
  28. # https://example.com, and you plan to copy the files from there.
  29. # Source site:
  30. # Location of files: https://example.com/sites/example.com/files
  31. # Public scheme: sites/example.com/files
  32. # In this example, source_base_path should be 'https://example.com'.
  33. #
  34. # See the configuration for the source_full_path property in the process
  35. # section below.
  36. source_base_path: ''
  37. process:
  38. # If you are using both this migration and d6_user_picture_file in a custom
  39. # migration and executing migrations incrementally, it is strongly
  40. # recommended that you remove the fid mapping to avoid potential ID conflicts.
  41. # For that reason, this mapping is commented out by default.
  42. # fid: fid
  43. filename: filename
  44. source_full_path:
  45. -
  46. plugin: concat
  47. delimiter: /
  48. source:
  49. - constants/source_base_path
  50. - filepath
  51. -
  52. plugin: urlencode
  53. destination_full_path:
  54. plugin: file_uri
  55. source:
  56. - filepath
  57. - file_directory_path
  58. - temp_directory_path
  59. - is_public
  60. uri:
  61. plugin: file_copy
  62. source:
  63. - '@source_full_path'
  64. - '@destination_full_path'
  65. filemime: filemime
  66. # No need to migrate filesize, it is computed when file entities are saved.
  67. # filesize: filesize
  68. status: status
  69. changed: timestamp
  70. uid: uid
  71. destination:
  72. plugin: entity:file

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.