Migrating images and files I am trying to migrate a Drupal 7 site to a Drupal 8 site. I already created my module for migration and I have a content type that has a title, field_picture and a field_text in Drupal 7.

I want to migrate it to Drupal 8 where field_text = field_description and field_picture is field_image.

I tried the following:

id: drupal7_fruit
label: "Test migration"
migration_group: drupal7
source:
  plugin: d7_node
  node_type: fruit
process:
  nid: nid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  field_description: field_text
  field_image:
    plugin: iterator
    source: field_picture
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
destination:
  plugin: 'entity:node'
  default_bundle: fruit
migration_dependencies: {}


I could migrate description and title, but the image is never migrated.

What am I doing wrong?

EDIT

migrate_plus.migration.drupal7_fruit.yml

    id: drupal7_fruit
label: "Migrate Fruit Content Type"
migration_group: drupal7
source:
  plugin: d7_node
  node_type: fruit
process:
  nid: nid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  field_descricao: field_body
destination:
  plugin: 'entity:node'
  default_bundle: fruit
  migration_dependencies:
    optional: drupal7_image


migrate_plus.migration.drupal7_image.yml   

 id: drupal7_image
label: Images
migration_tags:
  - Drupal 7
source:
  plugin: d7_file
  constants:
    source_base_path: ''
process:
  fid: fid
  filename: filename
  source_full_path:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/source_base_path
        - filepath
    -
      plugin: urlencode
  uri:
    plugin: file_copy
    source:
      - '@source_full_path'
      - uri
  filemime: filemime
  status: status
  created: timestamp
  changed: timestamp
  uid: uid
destination:
  plugin: entity:file


Edited my question because @Berdir in the comments said that images or files must have a different migration file but still can't migrate images. I restored my D8 site database to start all from scratch.
Thank you for Berdir's help but I noticed that I was missing some information on my drupal7_fruit migration file like the values for field_image and migration dependencies.

The working solution:

migrate_plus.migration.drupal7_image.yml

id: drupal7_image
label: Images
migration_group: drupal7
migration_tags:
  - Drupal 7
source:
  plugin: d7_file
  constants:
    source_base_path: '/var/www/username/drupal7/' # Full location of your drupal7 site
process:
  fid: fid
  filename: filename
  source_full_path:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/source_base_path
        - filepath
    -
      plugin: urlencode
  uri:
    plugin: file_copy
    source:
      - '@source_full_path'
      - uri
  filemime: filemime
  status: status
  created: timestamp
  changed: timestamp
  uid: uid
destination:
  plugin: entity:file
migration_dependencies: {}


migration_plus.migration.drupal7_fruit.yml

id: drupal7_fruta
label: "Migrate Fruit Content Type"
migration_group: drupal7
migration_tags:
  - Drupal 7
source:
  plugin: d7_node
  node_type: fruit
process:
  nid: nid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  field_description: field_body
  field_image: # Image field name in Drupal 8 site
    plugin: iterator
    source: field_photo # Image field name in Drupal 7 site
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
destination:
  plugin: 'entity:node'
  default_bundle: fruit    

migration_dependencies:
  required: 
    - drupal7_image


Hope this may help anyone with the same problem in the future!