From 608039b407ed86b3d8a96c7624573d334997ace7 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 6 May 2020 02:00:02 +0100 Subject: [PATCH] Migrate tags to blog posts --- .idea/saveactions_settings.xml | 14 ++++++ .../migrate_plus.migration.post_node.yml | 44 +++++++++++++------ .../migrate_plus.migration.tag_term.yml | 4 +- 3 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 .idea/saveactions_settings.xml diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..f5eba10 --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/web/modules/custom/custom/migrations/migrate_plus.migration.post_node.yml b/web/modules/custom/custom/migrations/migrate_plus.migration.post_node.yml index 0a52077..0c4b6fa 100644 --- a/web/modules/custom/custom/migrations/migrate_plus.migration.post_node.yml +++ b/web/modules/custom/custom/migrations/migrate_plus.migration.post_node.yml @@ -4,53 +4,69 @@ source: plugin: url data_fetcher_plugin: http data_parser_plugin: json - urls: http://localhost:9000/posts.json + + urls: https://deploy-preview-213--opdavies.netlify.app/posts.json + ids: id: type: integer + item_selector: posts/ + fields: - - - name: id + - name: id selector: id label: Node ID - - - name: title + + - name: title selector: title label: Title - - - name: created + + - name: created selector: created label: Created - - - name: status + + - name: status selector: status label: Status - - - name: content + + - name: content selector: content label: Content - - - name: path + + - name: path selector: path label: Path + - name: tags + selector: tags + label: Tags + process: body/0/format: plugin: default_value default_value: full_html + body/0/value: content + title: title created: created changed: created path: path status: status + + field_tags: + plugin: migration_lookup + migration: tag_term + source: tags + type: plugin: default_value default_value: post + uid: plugin: default_value default_value: 1 destination: - plugin: 'entity:node' \ No newline at end of file + plugin: 'entity:node' diff --git a/web/modules/custom/custom/migrations/migrate_plus.migration.tag_term.yml b/web/modules/custom/custom/migrations/migrate_plus.migration.tag_term.yml index e1672a1..93be32f 100644 --- a/web/modules/custom/custom/migrations/migrate_plus.migration.tag_term.yml +++ b/web/modules/custom/custom/migrations/migrate_plus.migration.tag_term.yml @@ -6,8 +6,8 @@ source: data_parser_plugin: json urls: https://deploy-preview-213--opdavies.netlify.app/tags.json ids: - id: - type: integer + name: + type: string item_selector: tags/ fields: -