migrate all files; node materiau field_materiau_images; view files
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Every migration that references a file by Drupal 7 fid should specify this
|
||||
# migration as an optional dependency.
|
||||
id: d7_allpublicfiles
|
||||
label: Public files
|
||||
migration_group: d7_materio
|
||||
audit: true
|
||||
migration_tags:
|
||||
- Drupal 7
|
||||
- Content
|
||||
source:
|
||||
plugin: d7_file
|
||||
scheme: public
|
||||
constants:
|
||||
# The tool configuring this migration must set source_base_path. 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: '../../d7.materio.com/public_html'
|
||||
process:
|
||||
# If you are using this file to build a custom migration consider removing
|
||||
# the fid field to allow incremental migrations.
|
||||
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
|
||||
# No need to migrate filesize, it is computed when file entities are saved.
|
||||
# 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
|
@@ -76,10 +76,11 @@ process:
|
||||
|
||||
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_taxonomy_term_thesaurus
|
||||
- d7_taxonomy_term_tags
|
||||
- d7_taxonomy_term_company
|
||||
- d7_taxonomy_term_showroom
|
||||
optional:
|
||||
- d7_node_materiau
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
- d7_taxonomy_term_thesaurus
|
||||
- d7_taxonomy_term_tags
|
||||
- d7_taxonomy_term_company
|
||||
- d7_taxonomy_term_showroom
|
||||
optional:
|
||||
- d7_node_materiau
|
||||
|
@@ -55,18 +55,22 @@ process:
|
||||
plugin: migration_lookup
|
||||
migration: d7_taxonomy_term_thesaurus
|
||||
source: field_onthologie
|
||||
no_stub: true
|
||||
field_tags:
|
||||
plugin: migration_lookup
|
||||
migration: d7_taxonomy_term_tags
|
||||
source: field_tags_libres
|
||||
no_stub: true
|
||||
field_manufacturer:
|
||||
plugin: migration_lookup
|
||||
migration: d7_taxonomy_term_company
|
||||
source: field_company_fab
|
||||
no_stub: true
|
||||
field_distributor:
|
||||
plugin: migration_lookup
|
||||
migration: d7_taxonomy_term_company
|
||||
source: field_company_distrib
|
||||
no_stub: true
|
||||
field_video:
|
||||
plugin: iterator
|
||||
source: field_video_filter
|
||||
@@ -91,7 +95,30 @@ process:
|
||||
migration: d7_node_breve
|
||||
no_stub: true
|
||||
|
||||
# field_materiau_images: field_materiau_image
|
||||
# field_materiau_images:
|
||||
# -
|
||||
# plugin: skip_on_empty
|
||||
# method: process
|
||||
# source: field_materiau_image
|
||||
# -
|
||||
# plugin: migration_lookup
|
||||
# migration: d7_allpublicfiles
|
||||
# no_stub: true
|
||||
|
||||
field_materiau_images:
|
||||
plugin: iterator
|
||||
source: field_materiau_image
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: d7_allpublicfiles
|
||||
source: fid
|
||||
no_stub: true
|
||||
alt: alt
|
||||
title: title
|
||||
height: height
|
||||
width: width
|
||||
|
||||
# field_attachments: field_attachments
|
||||
|
||||
# field_famille: field_famille
|
||||
@@ -104,10 +131,11 @@ process:
|
||||
# : field_location
|
||||
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_taxonomy_term_thesaurus
|
||||
- d7_taxonomy_term_tags
|
||||
- d7_taxonomy_term_company
|
||||
- d7_taxonomy_term_showroom
|
||||
optional:
|
||||
- d7_node_breve
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
- d7_taxonomy_term_thesaurus
|
||||
- d7_taxonomy_term_tags
|
||||
- d7_taxonomy_term_company
|
||||
- d7_taxonomy_term_showroom
|
||||
optional:
|
||||
- d7_node_breve
|
||||
|
@@ -44,7 +44,7 @@ process:
|
||||
field_migration:
|
||||
plugin: default_value
|
||||
default_value: 'migration_imported'
|
||||
|
||||
|
||||
# FROM TODE (linked tode node)
|
||||
field_website:
|
||||
plugin: iterator
|
||||
@@ -118,3 +118,7 @@ process:
|
||||
|
||||
# not ready
|
||||
# field_attachments: field_attachments
|
||||
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_allpublicfiles
|
||||
|
Reference in New Issue
Block a user