Migration with custom files path I have to migrate a website from Drupal 7 to Drupal 9.
My Drupal 7 files were located in this directory : sites/mywebsite/files
In Drupal 9, files will be located in this directory : sites/default/files
While paths are automatically managed by media module in ckeditor in D9, the path for every file is still sites/mywebsite/files/myfile.pdf. I don't know where to change it.
How to fix this?
Thanks
You can achieve that by adopting the below snippet to your use case.
source:
  constants:
    PROFILE_PICTURES_FILE_DIRECTORY: 'public://profile_pictures/'

process:

  profile_picture_destination_filename_base:
    -
      plugin: concat
      source:
        - title
        - field_account_id
      delimiter: '-'

  profile_picture_destination_filename:
    -
      plugin: callback
      callable: basename
      source: field_profile_picture # This is the photo URL column.
    -
      plugin: callback
      callable: ucfirst

  profile_picture_destination_full_path:
    -
      plugin: concat
      source:
        - constants/PROFILE_PICTURES_FILE_DIRECTORY
        - '@profile_picture_destination_filename_base'
        - '@profile_picture_destination_filename'
    -
      plugin: urlencode

  profile_picture_source_image_path:
    -
      plugin: urlencode
      source: field_profile_picture # This is the photo URL column.
  uri:
    plugin: file_copy
    source:
      - '@profile_picture_source_image_path'
      - '@profile_picture_destination_full_path'
    file_exists: 'rename'
    move: FALSE