Refactor all general entity type migrations into separate bundle specific migrations + general/common field migrations.
This commit is contained in:
parent
b21695b4f8
commit
6829453d7e
|
@ -1,210 +0,0 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- asset
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset
|
||||
label: 'Assets'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Static map old asset types to new.
|
||||
# This only handles known asset types provided by farmOS core.
|
||||
# If the asset type is not found in this map, then the asset will be skipped.
|
||||
# Contrib farmOS modules are responsible for migrating their own asset types.
|
||||
type:
|
||||
plugin: static_map
|
||||
source: type
|
||||
map:
|
||||
animal: animal
|
||||
compost: compost
|
||||
equipment: equipment
|
||||
group: group
|
||||
planting: plant
|
||||
sensor: sensor
|
||||
bypass: FALSE
|
||||
# Hmm. This default_value is at odds with our overlapping needs.
|
||||
# - Without this default_value, the parent field migration tries to create
|
||||
# a stub but fails at this process because the type source is not set
|
||||
# during stub creation.
|
||||
# - With this default_value, `bypass: FALSE` has no effect. Which means
|
||||
# all assets will be imported, and wl have a type of `stub` if their
|
||||
# source type is not in this map.
|
||||
# - Alternatively, we could set `bypass: TRUE` and omit `default_value`,
|
||||
# which would result in the creation of assets even if their asset type
|
||||
# does not exist.
|
||||
# - On one hand, this would make contrib asset type migrations easier.
|
||||
# - On the other hand, it means our current approach of "only enable
|
||||
# modules for the data you want to migrate" is no longer true. All
|
||||
# data will be migrated.
|
||||
# - Come to think of it, we're already breaking this promise by
|
||||
# not having separate migrations for each asset type. There may
|
||||
# be asset types in this map that were not enabled. They would
|
||||
# still be migrated, simply because they are in this map.
|
||||
#
|
||||
# With all the above in mind, we have two choices:
|
||||
# - Accept that we can't promise "only the modules you enable will be
|
||||
# migrated". Migrate all data regardless.
|
||||
# - This may be OK for core asset/log types, but what about contrib? If
|
||||
# a contrib module is not ready for 2.x, then data will be migrated
|
||||
# for it, but it will be orphaned in the db as an unknown bundle.
|
||||
# - Take a different approach. Flip this on its head: create separate
|
||||
# migrations for each bundle, and a general migration for common fields,
|
||||
# but run the bundle migrations first, and fill in the common fields
|
||||
# second, only on the entities that were imported by the bundle
|
||||
# migrations.
|
||||
# - How do we set the dependencies on the migrations to accomplish
|
||||
# this?
|
||||
# - The common fields migration can't explicitly list the bundle
|
||||
# migrations as required dependencies, because then all the bundles
|
||||
# would be required.
|
||||
# - Optional dependencies could work, but only for the bundle
|
||||
# migrations we know about in core. Contrib bundles would also need
|
||||
# some way of ensuring that they run first.
|
||||
default_value: stub
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
name:
|
||||
plugin: get
|
||||
source: name
|
||||
uid:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: uid
|
||||
-
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_user
|
||||
source: uid
|
||||
created:
|
||||
plugin: get
|
||||
source: created
|
||||
changed:
|
||||
plugin: get
|
||||
source: changed
|
||||
# Map the old archived value to both an archived timestamp and a status.
|
||||
# If the old value is 0, status is active. Otherwise, it is archived.
|
||||
archived:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: archived
|
||||
-
|
||||
plugin: get
|
||||
source: archived
|
||||
status:
|
||||
plugin: static_map
|
||||
source: archived
|
||||
map:
|
||||
0: active
|
||||
default_value: archived
|
||||
notes:
|
||||
plugin: sub_process
|
||||
source: field_farm_description
|
||||
process:
|
||||
value:
|
||||
plugin: get
|
||||
source: value
|
||||
format:
|
||||
plugin: static_map
|
||||
source: format
|
||||
map:
|
||||
farm_format: default
|
||||
plain_text: plain_text
|
||||
default_value: default
|
||||
data:
|
||||
plugin: get
|
||||
source: field_farm_data
|
||||
flag:
|
||||
plugin: get
|
||||
source: field_farm_flags
|
||||
parent:
|
||||
plugin: sub_process
|
||||
source: field_farm_parent
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_asset
|
||||
source: target_id
|
||||
file:
|
||||
plugin: sub_process
|
||||
source: field_farm_files
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
no_stub: true
|
||||
source: fid
|
||||
display: display
|
||||
description: description
|
||||
image:
|
||||
plugin: sub_process
|
||||
source: field_farm_images
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
no_stub: true
|
||||
source: fid
|
||||
alt: alt
|
||||
title: title
|
||||
width: width
|
||||
height: height
|
||||
|
||||
# Animal specific fields.
|
||||
birthdate:
|
||||
plugin: get
|
||||
source: field_farm_date
|
||||
nickname:
|
||||
plugin: get
|
||||
source: field_farm_animal_nicknames
|
||||
sex:
|
||||
plugin: get
|
||||
source: field_farm_animal_sex
|
||||
castrated:
|
||||
plugin: get
|
||||
source: field_farm_animal_castrated
|
||||
|
||||
# Equipment specific fields.
|
||||
manufacturer:
|
||||
plugin: get
|
||||
source: field_farm_manufacturer
|
||||
model:
|
||||
plugin: get
|
||||
source: field_farm_model
|
||||
serial_number:
|
||||
plugin: get
|
||||
source: field_farm_serial_number
|
||||
|
||||
# Plant specific fields.
|
||||
season:
|
||||
plugin: sub_process
|
||||
source: field_farm_season
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_term
|
||||
source: tid
|
||||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
- farm_migrate_user
|
||||
optional:
|
||||
- farm_migrate_asset
|
|
@ -0,0 +1,142 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- asset
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset_fields
|
||||
label: 'Common asset fields'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Look up assets created by type-specific migrations.
|
||||
id:
|
||||
plugin: migration_lookup
|
||||
source: id
|
||||
migration:
|
||||
- farm_migrate_asset_animal
|
||||
- farm_migrate_asset_compost
|
||||
- farm_migrate_asset_equipment
|
||||
- farm_migrate_asset_group
|
||||
- farm_migrate_asset_plant
|
||||
- farm_migrate_asset_sensor
|
||||
no_stub: true
|
||||
name:
|
||||
plugin: get
|
||||
source: name
|
||||
uid:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: uid
|
||||
-
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_user
|
||||
source: uid
|
||||
created:
|
||||
plugin: get
|
||||
source: created
|
||||
changed:
|
||||
plugin: get
|
||||
source: changed
|
||||
# Map the old archived value to both an archived timestamp and a status.
|
||||
# If the old value is 0, status is active. Otherwise, it is archived.
|
||||
archived:
|
||||
-
|
||||
plugin: skip_on_empty
|
||||
method: process
|
||||
source: archived
|
||||
-
|
||||
plugin: get
|
||||
source: archived
|
||||
status:
|
||||
plugin: static_map
|
||||
source: archived
|
||||
map:
|
||||
0: active
|
||||
default_value: archived
|
||||
notes:
|
||||
plugin: sub_process
|
||||
source: field_farm_description
|
||||
process:
|
||||
value:
|
||||
plugin: get
|
||||
source: value
|
||||
format:
|
||||
plugin: static_map
|
||||
source: format
|
||||
map:
|
||||
farm_format: default
|
||||
plain_text: plain_text
|
||||
default_value: default
|
||||
data:
|
||||
plugin: get
|
||||
source: field_farm_data
|
||||
flag:
|
||||
plugin: get
|
||||
source: field_farm_flags
|
||||
parent:
|
||||
plugin: sub_process
|
||||
source: field_farm_parent
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
source: target_id
|
||||
migration:
|
||||
- farm_migrate_asset_animal
|
||||
- farm_migrate_asset_compost
|
||||
- farm_migrate_asset_equipment
|
||||
- farm_migrate_asset_group
|
||||
- farm_migrate_asset_plant
|
||||
- farm_migrate_asset_sensor
|
||||
no_stub: true
|
||||
file:
|
||||
plugin: sub_process
|
||||
source: field_farm_files
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
no_stub: true
|
||||
source: fid
|
||||
display: display
|
||||
description: description
|
||||
image:
|
||||
plugin: sub_process
|
||||
source: field_farm_images
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
no_stub: true
|
||||
source: fid
|
||||
alt: alt
|
||||
title: title
|
||||
width: width
|
||||
height: height
|
||||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
- farm_migrate_user
|
||||
optional:
|
||||
- farm_migrate_asset_animal
|
||||
- farm_migrate_asset_compost
|
||||
- farm_migrate_asset_equipment
|
||||
- farm_migrate_asset_group
|
||||
- farm_migrate_asset_plant
|
||||
- farm_migrate_asset_sensor
|
|
@ -5,8 +5,8 @@ dependencies:
|
|||
module:
|
||||
- log
|
||||
- farm_migrate
|
||||
id: farm_migrate_log
|
||||
label: 'Logs'
|
||||
id: farm_migrate_log_fields
|
||||
label: 'Common log fields'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
|
@ -19,30 +19,23 @@ source:
|
|||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Static map old log types to new.
|
||||
# This only handles known log types provided by farmOS core.
|
||||
# If the log type is not found in this map, then the log will be skipped.
|
||||
# Contrib farmOS modules are responsible for migrating their own log types.
|
||||
type:
|
||||
plugin: static_map
|
||||
source: type
|
||||
map:
|
||||
farm_activity: activity
|
||||
farm_harvest: harvest
|
||||
farm_input: input
|
||||
farm_maintenance: maintenance
|
||||
farm_medical: medical
|
||||
farm_observation: observation
|
||||
farm_purchase: purchase
|
||||
farm_sale: sale
|
||||
farm_seeding: seeding
|
||||
farm_soil_test: lab_test
|
||||
farm_transplanting: transplanting
|
||||
farm_water_test: lab_test
|
||||
bypass: FALSE
|
||||
# Look up logs created by type-specific migrations.
|
||||
id:
|
||||
plugin: get
|
||||
plugin: migration_lookup
|
||||
source: id
|
||||
migration:
|
||||
- farm_migrate_log_activity
|
||||
- farm_migrate_log_harvest
|
||||
- farm_migrate_log_input
|
||||
- farm_migrate_log_lab_test
|
||||
- farm_migrate_log_maintenance
|
||||
- farm_migrate_log_medical
|
||||
- farm_migrate_log_observation
|
||||
- farm_migrate_log_purchase
|
||||
- farm_migrate_log_sale
|
||||
- farm_migrate_log_seeding
|
||||
- farm_migrate_log_transplanting
|
||||
no_stub: true
|
||||
name:
|
||||
plugin: get
|
||||
source: name
|
||||
|
@ -96,7 +89,7 @@ process:
|
|||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_term_log_category
|
||||
migration: farm_migrate_taxonomy_log_category
|
||||
source: tid
|
||||
flag:
|
||||
plugin: get
|
||||
|
@ -116,8 +109,9 @@ process:
|
|||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_asset
|
||||
migration: farm_migrate_asset_fields
|
||||
source: target_id
|
||||
no_stub: true
|
||||
file:
|
||||
plugin: sub_process
|
||||
source: field_farm_files
|
||||
|
@ -146,7 +140,6 @@ process:
|
|||
title: title
|
||||
width: width
|
||||
height: height
|
||||
|
||||
# Equipment used field.
|
||||
# This is added by the farm_equipment_field module in farmOS 1.x, and the
|
||||
# farm_equipment field in farmOS 2.x.
|
||||
|
@ -156,64 +149,26 @@ process:
|
|||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_asset
|
||||
migration: farm_migrate_asset_equipment
|
||||
source: target_id
|
||||
|
||||
# Source field (seeding and input logs).
|
||||
source:
|
||||
plugin: get
|
||||
source:
|
||||
- field_farm_input_source
|
||||
- field_farm_seed_source
|
||||
|
||||
# Lot number field (harvest, input, and seeding logs).
|
||||
lot_number:
|
||||
plugin: get
|
||||
source: field_farm_lot_number
|
||||
|
||||
# Input specific fields.
|
||||
method:
|
||||
plugin: get
|
||||
source: field_farm_input_method
|
||||
purchase_date:
|
||||
plugin: get
|
||||
source: field_farm_date_purchase
|
||||
material:
|
||||
plugin: sub_process
|
||||
source: field_farm_material
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_term
|
||||
source: tid
|
||||
|
||||
# Medical specific fields.
|
||||
vet:
|
||||
plugin: get
|
||||
source: field_farm_vet
|
||||
|
||||
# Invoice number field (sale and purchase logs).
|
||||
invoice_number:
|
||||
plugin: get
|
||||
source: field_farm_invoice_number
|
||||
|
||||
# Purchase specific fields.
|
||||
seller:
|
||||
plugin: get
|
||||
source: field_farm_seller
|
||||
|
||||
# Sale specific fields.
|
||||
customer:
|
||||
plugin: get
|
||||
source: field_farm_customer
|
||||
|
||||
# Lab field (lab test logs).
|
||||
lab:
|
||||
plugin: get_lab
|
||||
no_stub: true
|
||||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_asset
|
||||
- farm_migrate_asset_fields
|
||||
- farm_migrate_file
|
||||
- farm_migrate_file_private
|
||||
- farm_migrate_user
|
||||
optional: { }
|
||||
optional:
|
||||
- farm_migrate_asset_equipment
|
||||
- farm_migrate_log_activity
|
||||
- farm_migrate_log_harvest
|
||||
- farm_migrate_log_input
|
||||
- farm_migrate_log_lab_test
|
||||
- farm_migrate_log_maintenance
|
||||
- farm_migrate_log_medical
|
||||
- farm_migrate_log_observation
|
||||
- farm_migrate_log_purchase
|
||||
- farm_migrate_log_sale
|
||||
- farm_migrate_log_seeding
|
||||
- farm_migrate_log_transplanting
|
||||
- farm_migrate_taxonomy_log_category
|
|
@ -5,8 +5,8 @@ dependencies:
|
|||
module:
|
||||
- farm_migrate
|
||||
- taxonomy
|
||||
id: farm_migrate_taxonomy_term
|
||||
label: 'Taxonomy terms'
|
||||
id: farm_migrate_taxonomy_fields
|
||||
label: 'Common taxonomy term fields'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
|
@ -19,22 +19,15 @@ source:
|
|||
destination:
|
||||
plugin: 'entity:taxonomy_term'
|
||||
process:
|
||||
# Static map old vocabulary IDs to new.
|
||||
# This only handles known vocabularies provided by farmOS core.
|
||||
# If the vocabulary is not found in this map, then the term will be skipped.
|
||||
# Contrib farmOS modules are responsible for migrating their own
|
||||
# vocabularies.
|
||||
vid:
|
||||
plugin: static_map
|
||||
source: machine_name
|
||||
map:
|
||||
farm_log_categories: log_category
|
||||
farm_materials: material
|
||||
farm_season: season
|
||||
bypass: FALSE
|
||||
# Look up logs created by type-specific migrations.
|
||||
tid:
|
||||
plugin: get
|
||||
plugin: migration_lookup
|
||||
source: tid
|
||||
migration:
|
||||
- farm_migrate_taxonomy_log_category
|
||||
- farm_migrate_taxonomy_material
|
||||
- farm_migrate_taxonomy_season
|
||||
no_stub: true
|
||||
name:
|
||||
plugin: get
|
||||
source: name
|
||||
|
@ -54,8 +47,12 @@ process:
|
|||
source: parent
|
||||
-
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_term
|
||||
source: tid
|
||||
migration:
|
||||
- farm_migrate_taxonomy_log_category
|
||||
- farm_migrate_taxonomy_material
|
||||
- farm_migrate_taxonomy_season
|
||||
no_stub: true
|
||||
parent:
|
||||
plugin: default_value
|
||||
default_value: 0
|
||||
|
@ -72,4 +69,6 @@ process:
|
|||
migration_dependencies:
|
||||
required: { }
|
||||
optional:
|
||||
- farm_migrate_taxonomy_term
|
||||
- farm_migrate_taxonomy_log_category
|
||||
- farm_migrate_taxonomy_material
|
||||
- farm_migrate_taxonomy_season
|
|
@ -0,0 +1,46 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_animal
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset_animal
|
||||
label: 'Assets (Animals)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: animal
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: animal
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Animal specific fields.
|
||||
birthdate:
|
||||
plugin: get
|
||||
source: field_farm_date
|
||||
nickname:
|
||||
plugin: get
|
||||
source: field_farm_animal_nicknames
|
||||
sex:
|
||||
plugin: get
|
||||
source: field_farm_animal_sex
|
||||
castrated:
|
||||
plugin: get
|
||||
source: field_farm_animal_castrated
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_compost
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset_compost
|
||||
label: 'Assets (Compost)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: compost
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: compost
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,43 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_equipment
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset_equipment
|
||||
label: 'Assets (Equipment)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: equipment
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: equipment
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Equipment specific fields.
|
||||
manufacturer:
|
||||
plugin: get
|
||||
source: field_farm_manufacturer
|
||||
model:
|
||||
plugin: get
|
||||
source: field_farm_model
|
||||
serial_number:
|
||||
plugin: get
|
||||
source: field_farm_serial_number
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_group
|
||||
- farm_migrate
|
||||
id: farm_migrate_asset_group
|
||||
label: 'Assets (Groups)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: group
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: group
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,43 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_plant
|
||||
id: farm_migrate_asset_plant
|
||||
label: 'Assets (Plants)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: planting
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: plant
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Plant specific fields.
|
||||
season:
|
||||
plugin: sub_process
|
||||
source: field_farm_season
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_season
|
||||
source: tid
|
||||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_taxonomy_season
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_sensor
|
||||
id: farm_migrate_asset_sensor
|
||||
label: 'Assets (Sensors)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_asset
|
||||
bundle: sensor
|
||||
destination:
|
||||
plugin: 'entity:asset'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: sensor
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_activity
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_activity
|
||||
label: 'Logs (Activities)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_activity
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: activity
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,37 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_harvest
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_harvest
|
||||
label: 'Logs (Harvests)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_harvest
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: harvest
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Harvest specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
source: field_farm_lot_number
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,55 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_input
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_input
|
||||
label: 'Logs (Inputs)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_input
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: input
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Input specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
source: field_farm_lot_number
|
||||
material:
|
||||
plugin: sub_process
|
||||
source: field_farm_material
|
||||
process:
|
||||
target_id:
|
||||
plugin: migration_lookup
|
||||
migration: farm_migrate_taxonomy_material
|
||||
source: tid
|
||||
method:
|
||||
plugin: get
|
||||
source: field_farm_input_method
|
||||
purchase_date:
|
||||
plugin: get
|
||||
source: field_farm_date_purchase
|
||||
source:
|
||||
plugin: get
|
||||
source: field_farm_input_source
|
||||
migration_dependencies:
|
||||
required:
|
||||
- farm_migrate_taxonomy_material
|
||||
optional: { }
|
|
@ -0,0 +1,38 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_lab_test
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_lab_test
|
||||
label: 'Logs (Lab tests)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle:
|
||||
- farm_soil_test
|
||||
- farm_water_test
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: lab_test
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Lab test specific fields.
|
||||
lab:
|
||||
plugin: get_lab
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_maintenance
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_maintenance
|
||||
label: 'Logs (Maintenance)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_maintenance
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: maintenance
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,37 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_medical
|
||||
- farm_migrate
|
||||
id: farm_migrate_log_medical
|
||||
label: 'Logs (Medical)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_medical
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: medical
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Medical specific fields.
|
||||
vet:
|
||||
plugin: get
|
||||
source: field_farm_vet
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_observation
|
||||
id: farm_migrate_log_observation
|
||||
label: 'Logs (Observations)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_observation
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: observation
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,40 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_purchase
|
||||
id: farm_migrate_log_purchase
|
||||
label: 'Logs (Purchases)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_purchase
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: purchase
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Purchase specific fields.
|
||||
invoice_number:
|
||||
plugin: get
|
||||
source: field_farm_invoice_number
|
||||
seller:
|
||||
plugin: get
|
||||
source: field_farm_seller
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,40 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_sale
|
||||
id: farm_migrate_log_sale
|
||||
label: 'Logs (Sales)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_sale
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: sale
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Sale specific fields.
|
||||
customer:
|
||||
plugin: get
|
||||
source: field_farm_customer
|
||||
invoice_number:
|
||||
plugin: get
|
||||
source: field_farm_invoice_number
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,40 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_seeding
|
||||
id: farm_migrate_log_seeding
|
||||
label: 'Logs (Seedings)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_seeding
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: seeding
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
# Seeding specific fields.
|
||||
lot_number:
|
||||
plugin: get
|
||||
source: field_farm_lot_number
|
||||
source:
|
||||
plugin: get
|
||||
source: field_farm_seed_source
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_transplanting
|
||||
id: farm_migrate_log_transplanting
|
||||
label: 'Logs (Transplantings)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_log
|
||||
bundle: farm_transplanting
|
||||
destination:
|
||||
plugin: 'entity:log'
|
||||
process:
|
||||
# Hard-code the bundle.
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: transplanting
|
||||
# Maintain the asset ID.
|
||||
id:
|
||||
plugin: get
|
||||
source: id
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_log_category
|
||||
- farm_migrate
|
||||
id: farm_migrate_taxonomy_log_category
|
||||
label: 'Taxonomy terms (Log categories)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_taxonomy_term
|
||||
bundle: farm_log_categories
|
||||
destination:
|
||||
plugin: 'entity:taxonomy_term'
|
||||
process:
|
||||
# Hard-code the vocabulary.
|
||||
vid:
|
||||
plugin: default_value
|
||||
default_value: log_category
|
||||
# Maintain the term ID.
|
||||
tid:
|
||||
plugin: get
|
||||
source: tid
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_material
|
||||
- farm_migrate
|
||||
id: farm_migrate_taxonomy_material
|
||||
label: 'Taxonomy terms (Materials)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_taxonomy_term
|
||||
bundle: farm_materials
|
||||
destination:
|
||||
plugin: 'entity:taxonomy_term'
|
||||
process:
|
||||
# Hard-code the vocabulary.
|
||||
vid:
|
||||
plugin: default_value
|
||||
default_value: material
|
||||
# Maintain the term ID.
|
||||
tid:
|
||||
plugin: get
|
||||
source: tid
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
|
@ -0,0 +1,33 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- farm_migrate
|
||||
- farm_season
|
||||
id: farm_migrate_taxonomy_season
|
||||
label: 'Taxonomy terms (Seasons)'
|
||||
migration_group: farm_migrate
|
||||
migration_tags:
|
||||
- 'Drupal 7'
|
||||
- 'farmOS 1.x'
|
||||
class: Drupal\migrate\Plugin\Migration
|
||||
field_plugin_method: null
|
||||
cck_plugin_method: null
|
||||
source:
|
||||
plugin: d7_taxonomy_term
|
||||
bundle: farm_season
|
||||
destination:
|
||||
plugin: 'entity:taxonomy_term'
|
||||
process:
|
||||
# Hard-code the vocabulary.
|
||||
vid:
|
||||
plugin: default_value
|
||||
default_value: season
|
||||
# Maintain the term ID.
|
||||
tid:
|
||||
plugin: get
|
||||
source: tid
|
||||
migration_dependencies:
|
||||
required: { }
|
||||
optional: { }
|
Loading…
Reference in New Issue