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