You are here

wordpress_content.yml in WordPress Migrate 8.3

migrations/wordpress_content.yml

File

migrations/wordpress_content.yml
View source
  1. id: wordpress_content
  2. label: Import content from WordPress XML
  3. migration_tags:
  4. - WordPress
  5. source:
  6. plugin: url
  7. data_fetcher_plugin: http
  8. data_parser_plugin: xml
  9. # The item type selector (e.g. '[wp:post_type="post"]') is appended dynamically.
  10. item_selector: /rss/channel/item
  11. fields:
  12. -
  13. name: title
  14. label: Content title
  15. selector: title
  16. -
  17. name: post_id
  18. label: Unique content ID
  19. selector: wp:post_id
  20. -
  21. name: content
  22. label: Body of the content
  23. selector: content:encoded
  24. -
  25. name: excerpt
  26. label: Excerpt of the content
  27. selector: excerpt:encoded
  28. -
  29. name: pubDate
  30. label: Publish date of the content
  31. selector: pubDate
  32. -
  33. name: post_date
  34. label: Post date of the content
  35. selector: wp:post_date
  36. -
  37. name: status
  38. label: Published status of the content
  39. selector: wp:status
  40. -
  41. name: creator
  42. label: Username of the content creator
  43. selector: dc:creator
  44. -
  45. name: post_tag
  46. label: Tags assigned to the content item
  47. selector: 'category[@domain="post_tag"]/@nicename'
  48. -
  49. name: category
  50. label: Categories assigned to the content item
  51. selector: 'category[@domain="category"]/@nicename'
  52. -
  53. name: thumbnail_id
  54. label: Thumbnail assigned to the content item (Featured image)
  55. selector: wp:postmeta[wp:meta_key='_thumbnail_id']/wp:meta_value
  56. ids:
  57. post_id:
  58. type: integer
  59. process:
  60. # type mapping is dynamically generated.
  61. # uid mapping is dynamically generated.
  62. # tag/category field mappings are dynamically generated.
  63. title: title
  64. # @todo: Will need process plugin to rewrite links/img refs.
  65. # @link https://www.drupal.org/node/2742279
  66. 'body/value': content
  67. 'body/summary': excerpt
  68. created:
  69. plugin: callback
  70. source: post_date
  71. callable: strtotime
  72. changed: '@created'
  73. status:
  74. plugin: static_map
  75. source: status
  76. default_value: 0
  77. map:
  78. publish: 1
  79. destination:
  80. plugin: entity:node
  81. # Dependencies are dynamically generated.
  82. migration_dependencies: {}