You are here

wordpress_comment.yml in WordPress Migrate 8.3

migrations/wordpress_comment.yml

File

migrations/wordpress_comment.yml
View source
  1. id: wordpress_comment
  2. label: Import comments 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 parent type selector is modified dynamically.
  10. item_selector: /rss/channel/item/wp:comment
  11. fields:
  12. -
  13. name: comment_id
  14. label: Unique comment ID
  15. selector: wp:comment_id
  16. -
  17. name: comment_author
  18. label: Username of comment author, if logged in.
  19. selector: wp:comment_author
  20. -
  21. name: comment_author_email
  22. label: Email of comment author.
  23. selector: wp:comment_author_email
  24. -
  25. name: comment_author_url
  26. label: Website of comment author.
  27. selector: wp:comment_author_url
  28. -
  29. name: comment_author_IP
  30. label: IP address of comment author.
  31. selector: wp:comment_author_IP
  32. -
  33. name: comment_date
  34. label: Datetime of comment (local time).
  35. selector: wp:comment_date
  36. -
  37. name: comment_date_gmt
  38. label: Datetime of comment (GMT).
  39. selector: wp:comment_date_gmt
  40. -
  41. name: comment_content
  42. label: Body of the content
  43. selector: wp:comment_content
  44. -
  45. name: comment_approved
  46. label: Whether the comment has been approved (published).
  47. selector: wp:comment_approved
  48. -
  49. name: comment_type
  50. label: The comment type.
  51. selector: wp:comment_type
  52. -
  53. name: comment_parent
  54. label: comment_id of the comment's parent.
  55. selector: wp:comment_parent
  56. -
  57. name: post_id
  58. label: post_id of the parent content item.
  59. selector: ..\wp:post_id
  60. ids:
  61. comment_id:
  62. type: integer
  63. process:
  64. entity_id:
  65. plugin: migration_lookup
  66. source: post_id
  67. # migration generated dynamically.
  68. pid:
  69. plugin: migration_lookup
  70. source: comment_parent
  71. # migration ID generated dynamically
  72. entity_type:
  73. plugin: default_value
  74. default_value: node
  75. comment_type:
  76. plugin: default_value
  77. # Comment type generated dynamically
  78. field_name:
  79. plugin: default_value
  80. # Comment field name generated dynamically.
  81. name: comment_author
  82. mail: comment_author_email
  83. homepage: comment_author_url
  84. hostname: comment_author_IP
  85. comment_body: comment_content
  86. created:
  87. plugin: callback
  88. source: comment_date
  89. callable: strtotime
  90. changed: '@created'
  91. status: comment_approved
  92. destination:
  93. plugin: entity:comment
  94. # Dependencies are dynamically generated.
  95. migration_dependencies: {}