Skip to content

Instantly share code, notes, and snippets.

@bmsimo
Created January 17, 2023 16:51
Show Gist options
  • Save bmsimo/22933b54a481e5984e8d09ef89deb84a to your computer and use it in GitHub Desktop.
Save bmsimo/22933b54a481e5984e8d09ef89deb84a to your computer and use it in GitHub Desktop.
Migrate Pages in Drupal
id: migrate_paginas
label: Archivo de Migracion del tipo de contenido Paginas
migration_tags:
- content_types
source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: json
urls:
- modules/custom/MODULE_NAME/migrations/json/pages.json
item_selector: /
fields:
- name: nid
label: "Unique ID"
selector: nid
- name: vid
label: "Revision ID"
selector: vid
- name: uuid
label: "UUID"
selector: uuid
- name: uid
label: "User ID"
selector: uid
- name: created
label: "Created"
selector: created
- name: changed
label: "Changed"
selector: changed
- name: status
label: "Status"
selector: status
- name: path
label: "Path"
selector: path
- name: title
label: "Title"
selector: title
- name: body
label: "Cuerpo"
selector: body
ids:
nid:
type: integer
process:
type:
plugin: default_value
default_value: page
uuid: uuid
vid: vid
uid: uid
nid: nid
created: created
changed: changed
status:
plugin: static_map
source: status
map:
1: true
0: false
path:
plugin: get
source: path
title: title
body/value:
plugin: get
source: body/value
body/format:
- plugin: static_map
source: body/format
default_value: html_completo
map:
"basic_html": "html_completo"
"full_html": "html_completo"
destination:
plugin: "entity:node"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment