Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example redirect migration from XML source in Drupal 8.
id: redirects
label: Old article paths.
migration_group: content
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: simple_xml
urls: http://kevinquillen.com/atom.xml
namespaces:
atom: http://www.w3.org/2005/Atom
item_selector: //atom:entry
fields:
-
name: slug
label: 'ID'
selector: atom:id
ids:
slug:
type: string
constants:
redirect_prefix: 'internal:/node/'
uid: 1
status: 301
destination:
plugin: 'entity:redirect'
process:
node:
plugin: migration_lookup
source: slug
migration: article
redirect_source:
- plugin: str_replace
source: slug
search: 'http://kevinquillen.com/'
replace: ''
redirect_redirect:
plugin: concat
source:
- constants/redirect_prefix
- "@node"
uid: constants/uid
status_code: constants/status
dependencies:
enforced:
module:
- kevinquillen_migration
migration_dependencies:
required:
- article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.