d7_file_private.yml 1.42 KB
Newer Older
1
id: d7_file_private
2
label: Private files
3
audit: true
4
5
migration_tags:
  - Drupal 7
6
  - Content
7
8
9
10
11
12
13
14
15
16
17
18
19
source:
  plugin: d7_file
  scheme: private
  constants:
    # source_base_path must be set by the tool configuring this migration.
    # It represents the fully qualified path relative to which uris in the files
    # 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: ''
process:
  # If you are using this file to build a custom migration consider removing
  # the fid field to allow incremental migrations.
  fid: fid
20
21
22
23
24
25
26
27
  # File entity module uses file_managed.filename as the entity title, while
  # Drupal 8 expects this to be an actual file name. Therefore, extract the
  # filename from the uri field. Otherwise, the file will migrate but form
  # validation won't pass when editing it.
  filename:
    plugin: callback
    callable: basename
    source: uri
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  source_full_path:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/source_base_path
        - filepath
  uri:
    plugin: file_copy
    source:
      - '@source_full_path'
      - uri
  filemime: filemime
  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