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