BIG REFACTORING using composer create-project drupal-composer/drupal-project

This commit is contained in:
2019-01-28 17:05:29 +01:00
parent 17bb6e1dbc
commit 37689c3d4b
504 changed files with 1740 additions and 628 deletions

View File

@@ -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

View File

@@ -0,0 +1,97 @@
id: d7_node_breve
label: Node Breve
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_node_breve
node_type: breve
destination:
plugin: entity:node
process:
# nid: nid
type:
plugin: default_value
default_value: breve
title: title
field_migration:
plugin: default_value
default_value: 'migration_imported'
body:
plugin: iterator
source: field_description
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
langcode: language
field_memo: field_memo
field_workflow:
-
plugin: default_value
source: workflow
default_value: 2
-
plugin: static_map
default_value: 2
map:
1: "workflow_creation"
2: "workflow_hidden"
3: "workflow_visible"
4: "workflow_imported"
5: "workflow_edited"
field_thesaurus:
plugin: migration_lookup
migration: d7_taxonomy_term_thesaurus
source: field_onthologie
field_tags:
plugin: migration_lookup
migration: d7_taxonomy_term_tags
source: field_tags_libres
field_video:
plugin: iterator
source: field_video_filter
process:
value: url
field_linked_materials:
-
plugin: skip_on_empty
method: process
source: linked_materials
-
plugin: migration_lookup
migration: d7_node_materiau
no_stub: true
field_visuel:
plugin: iterator
source: field_visuel
process:
target_id:
plugin: migration_lookup
migration: d7_allpublicfiles
source: fid
no_stub: true
alt: alt
title: title
height: height
width: width
migration_dependencies:
required:
- d7_allpublicfiles
- d7_taxonomy_term_thesaurus
- d7_taxonomy_term_tags
- d7_taxonomy_term_company
- d7_taxonomy_term_showroom
optional:
- d7_node_materiau

View File

@@ -0,0 +1,43 @@
id: d7_node_breve_i18n
label: Node Breve i18n
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
source:
plugin: d7_node_breve_i18n
node_type: breve
translations: true
destination:
plugin: entity:node
translations: true
process:
nid:
plugin: migration_lookup
source: nid
migration: d7_node_breve
no_stub: true
type:
plugin: default_value
default_value: breve
langcode: language
content_translation_source: source
title: title
body:
plugin: iterator
source: body
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
migration_dependencies:
required:
- d7_node_breve

View File

@@ -0,0 +1,147 @@
id: d7_node_materiau
label: Node Materiau
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
# deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_node_materiau
node_type: materiau
destination:
plugin: entity:node
process:
# nid: nid
type:
plugin: default_value
default_value: materiau
title: title
field_short_description: field_nature_titre
field_migration:
plugin: default_value
default_value: 'migration_imported'
body:
plugin: iterator
source: field_description
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
langcode: language
field_memo: field_memo
field_workflow:
-
plugin: default_value
source: workflow
default_value: 2
-
plugin: static_map
default_value: 2
map:
1: "workflow_creation"
2: "workflow_hidden"
3: "workflow_visible"
4: "workflow_imported"
5: "workflow_edited"
field_thesaurus:
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
process:
value: url
field_linked_materials:
-
plugin: skip_on_empty
method: process
source: linked_materials
-
plugin: migration_lookup
migration: d7_node_materiau
no_stub: true
field_linked_breves:
-
plugin: skip_on_empty
method: process
source: linked_breves
-
plugin: migration_lookup
migration: d7_node_breve
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:
plugin: iterator
source: field_attachments
process:
target_id:
plugin: migration_lookup
migration: d7_allpublicfiles
source: fid
no_stub: true
# there is no description field filled
description: description
field_famille: field_famille
field_index: field_identifiant
field_reference: field_reference_materio
# just archives
field_localisation_old: field_localisation
# custom module rebuilded
field_samples:
plugin: iterator
source: field_location
process:
location: location
target_id:
plugin: migration_lookup
migration: d7_taxonomy_term_showroom
source: showroom_tid
no_stub: true
migration_dependencies:
required:
- d7_allpublicfiles
- d7_taxonomy_term_thesaurus
- d7_taxonomy_term_tags
- d7_taxonomy_term_company
- d7_taxonomy_term_showroom
optional:
- d7_node_breve

View File

@@ -0,0 +1,44 @@
id: d7_node_materiau_i18n
label: Node Materiau i18n
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\node\Plugin\migrate\D7NodeDeriver
source:
plugin: d7_node_materiau_i18n
node_type: materiau
translations: true
destination:
plugin: entity:node
translations: true
process:
nid:
plugin: migration_lookup
source: nid
migration: d7_node_materiau
no_stub: true
type:
plugin: default_value
default_value: materiau
langcode: language
content_translation_source: source
title: title
field_short_description: field_nature_titre
body:
plugin: iterator
source: field_description
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
migration_dependencies:
required:
- d7_node_materiau

View File

@@ -0,0 +1,129 @@
id: d7_taxonomy_term_company
label: Taxonomy terms Company
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_company
bundle: company
destination:
plugin: entity:taxonomy_term
process:
# If you are using this file to build a custom migration consider removing
# the tid field to allow incremental migrations.
# tid: tid
vid:
plugin: default_value
default_value: company
name: name
weight: weight
# Only attempt to stub real (non-zero) parents.
parent_id:
-
plugin: skip_on_empty
method: process
source: parent
-
plugin: migration_lookup
migration: d7_taxonomy_term_companie
parent:
plugin: default_value
default_value: 0
source: '@parent_id'
changed: timestamp
langcode:
plugin: default_value
default_value: 'und'
field_migration:
plugin: default_value
default_value: 'migration_imported'
# FROM TODE (linked tode node)
field_website:
plugin: iterator
source: field_website
process:
uri: url
title: title
options: attributes
field_memo: field_memo
field_public_phone: public_phone
field_public_email:
plugin: iterator
source: field_public_email
process:
value: email
field_public_address:
plugin: iterator
source: field_public_address
process:
# langcode:
country_code: country
administrative_area: administrative_area
locality: locality
dependent_locality: dependent_locality
postal_code: postal_code
# sorting_code:
address_line1: thoroughfare
# address_line2:
organization: organisation_name
given_name: first_name
# additional_name:
family_name: last_name
# SOURCES
# sub_administrative_area
# premise
# sub_premise
# name_line
# data
field_note: field_note
field_departement: field_departement
description:
plugin: iterator
source: body
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
field_infos_from_company:
plugin: iterator
source: field_infos_from_company
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
field_workflow:
plugin: static_map
source: workflow
map:
1: "workflow_creation"
2: "workflow_hidden"
3: "workflow_visible"
4: "workflow_imported"
5: "workflow_edited"
field_attachments:
plugin: iterator
source: field_attachments
process:
target_id:
plugin: migration_lookup
migration: d7_allpublicfiles
source: fid
no_stub: true
# there is no description field filled
description: description
migration_dependencies:
required:
- d7_allpublicfiles

View File

@@ -0,0 +1,87 @@
id: d7_taxonomy_term_showroom
label: Taxonomy terms Showroom
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_showroom
bundle: showroom
destination:
plugin: entity:taxonomy_term
process:
# If you are using this file to build a custom migration consider removing
# the tid field to allow incremental migrations.
# tid: tid
vid:
plugin: default_value
default_value: showroom
name: name
weight: weight
parent:
plugin: default_value
default_value: 0
changed: timestamp
langcode:
plugin: default_value
default_value: 'und'
field_migration:
plugin: default_value
default_value: 'migration_imported'
field_workflow:
plugin: default_value
default_value: 'workflow_visible'
# tode node showroom
field_website:
plugin: iterator
source: field_website
process:
uri: url
title: title
options: attributes
field_memo: field_memo
field_public_phone: public_phone
field_public_email:
plugin: iterator
source: field_public_email
process:
value: email
field_public_address:
plugin: iterator
source: field_public_address
process:
# langcode:
country_code: country
administrative_area: administrative_area
locality: locality
dependent_locality: dependent_locality
postal_code: postal_code
# sorting_code:
address_line1: thoroughfare
# address_line2:
organization: organisation_name
given_name: first_name
# additional_name:
family_name: last_name
# SOURCES
# sub_administrative_area
# premise
# sub_premise
# name_line
# data
description:
plugin: iterator
source: body
process:
value: value
format:
plugin: default_value
default_value: wysiwyg

View File

@@ -0,0 +1,48 @@
id: d7_taxonomy_term_tags
label: Taxonomy terms Tags
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_tags
bundle: tag_libres
destination:
plugin: entity:taxonomy_term
process:
# If you are using this file to build a custom migration consider removing
# the tid field to allow incremental migrations.
# tid: tid
vid:
plugin: default_value
default_value: tags
name: name
'description/value': description
'description/format': format
weight: weight
# Only attempt to stub real (non-zero) parents.
parent_id:
-
plugin: skip_on_empty
method: process
source: parent
-
plugin: migration_lookup
migration: d7_taxonomy_term_tags
parent:
plugin: default_value
default_value: 0
source: '@parent_id'
changed: timestamp
#synonyms
field_synonyms: synonyms_synonym
# used on advanced search
# field_used_on_advanced_search: field_used_on_advanced_search

View File

@@ -0,0 +1,39 @@
id: d7_taxonomy_term_tags_i18n
label: Taxonomy terms Tags i18n
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_tags_i18n
bundle: tag_libres
translations: true
destination:
plugin: entity:taxonomy_term
translations: true
process:
tid:
plugin: migration_lookup
migration: d7_taxonomy_term_tags
source: tid
vid:
plugin: default_value
default_value: tags
langcode: language
name: name
'description/value': description
'description/format': format
field_synonyms: synonyms_synonym
migration_dependencies:
required:
- d7_taxonomy_term_tags

View File

@@ -0,0 +1,48 @@
id: d7_taxonomy_term_thesaurus
label: Taxonomy terms Thesaurus
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_thesaurus
bundle: onthologie
destination:
plugin: entity:taxonomy_term
process:
# If you are using this file to build a custom migration consider removing
# the tid field to allow incremental migrations.
# tid: tid
vid:
plugin: default_value
default_value: thesaurus
name: name
'description/value': description
'description/format': format
weight: weight
# Only attempt to stub real (non-zero) parents.
parent_id:
-
plugin: skip_on_empty
method: process
source: parent
-
plugin: migration_lookup
migration: d7_taxonomy_term_thesaurus
parent:
plugin: default_value
default_value: 0
source: '@parent_id'
changed: timestamp
#synonyms
field_synonyms: synonyms_synonym
# used on advanced search
field_used_on_advanced_search: field_used_on_advanced_search

View File

@@ -0,0 +1,39 @@
id: d7_taxonomy_term_thesaurus_i18n
label: Taxonomy terms Thesaurus i18n
migration_group: d7_materio
audit: true
migration_tags:
- Drupal 7
- Content
- Materio
deriver: Drupal\taxonomy\Plugin\migrate\D7TaxonomyTermDeriver
source:
plugin: d7_taxonomy_term_thesaurus_i18n
bundle: onthologie
translations: true
destination:
plugin: entity:taxonomy_term
translations: true
process:
tid:
plugin: migration_lookup
migration: d7_taxonomy_term_thesaurus
source: tid
vid:
plugin: default_value
default_value: thesaurus
langcode: language
name: name
'description/value': description
'description/format': format
field_synonyms: synonyms_synonym
migration_dependencies:
required:
- d7_taxonomy_term_thesaurus

View File

@@ -0,0 +1,11 @@
id: d7_materio
label: D7 Materio
description: Drupal 7 materio content migration to Drupal 8.
source_type: Drupal 7
shared_configuration:
source:
key: legacy
dependencies:
enforced:
module:
- materio_migrate