Adds migration configs.
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
# Migration configuration for importing basic pages.
|
||||
id: cdesai_basic_pages
|
||||
label: Import Basic Pages from CSV
|
||||
migration_group: CDESAI
|
||||
|
||||
source:
|
||||
# The custom CSV source plugin will fetch the source path from configs.
|
||||
# Upload source files at /admin/config/development/cdesai/migrate.
|
||||
plugin: 'cdesai_migrate_csv'
|
||||
source_config_key: cdesai_migrate_basic_pages_source
|
||||
|
||||
delimiter: ','
|
||||
enclosure: '"'
|
||||
header_offset: 0
|
||||
|
||||
ids:
|
||||
- page
|
||||
|
||||
process:
|
||||
langcode: en
|
||||
moderation_state: draft
|
||||
title: title
|
||||
|
||||
uid:
|
||||
plugin: default_value
|
||||
default_value: 1
|
||||
|
||||
field_content/target_id:
|
||||
# Skips a row if skip_migration property is set to TRUE.
|
||||
-
|
||||
plugin: skip_on_value
|
||||
equals: true
|
||||
source: skip_migration
|
||||
value: 'TRUE'
|
||||
method: row
|
||||
-
|
||||
plugin: migration_lookup
|
||||
migration: cdesai_paragraph_parents
|
||||
no_stub: true
|
||||
source: page
|
||||
-
|
||||
plugin: extract
|
||||
index:
|
||||
- '0'
|
||||
field_content/target_revision_id:
|
||||
-
|
||||
plugin: migration_lookup
|
||||
migration: cdesai_paragraph_parents
|
||||
no_stub: true
|
||||
source: page
|
||||
-
|
||||
plugin: extract
|
||||
index:
|
||||
- 1
|
||||
|
||||
field_category:
|
||||
# Do not process further if the category value is empty.
|
||||
-
|
||||
plugin: skip_on_value
|
||||
equals: true
|
||||
source: category
|
||||
value: ''
|
||||
method: process
|
||||
|
||||
# The plugin looks up for an exiting term based on the value_key property.
|
||||
# If no matching term is found, it creates one on the fly.
|
||||
-
|
||||
plugin: entity_generate
|
||||
source: category
|
||||
entity_type: taxonomy_term
|
||||
bundle_key: vid
|
||||
bundle: category
|
||||
value_key: name
|
||||
ignore_case: true
|
||||
|
||||
field_legacy_url: legacy_url
|
||||
|
||||
type:
|
||||
plugin: default_value
|
||||
default_value: basic_page
|
||||
|
||||
destination:
|
||||
plugin: 'entity:node'
|
||||
|
||||
# make sure these migration execute before running current migration
|
||||
migration_dependencies:
|
||||
required:
|
||||
- cdesai_paragraphs
|
||||
- cdesai_paragraph_parents
|
||||
|
||||
# use forced module dependency so uninstall/reinstall works properly
|
||||
dependencies:
|
||||
enforced:
|
||||
module:
|
||||
- cdesai_migrate
|
||||
Reference in New Issue
Block a user