I am trying to import my blogs from WordPress using this module but doing the second option which is:

"WordPress exported (WXR) file to import into Drupal" upload function.

The title and body pulled over perfectly, but the categories, tags, and comments did not import. We have multiple WordPress blogs which we want to no longer use (we're going to use Drupal blog type) and for one of our blogs we have 145 published with multiple categories and tags associated with each post that we need to convert/import into Drupal.

HELP Please!!

Comments

addisj’s picture

I am experiencing the same issue, except that the comments imported fine.

ptillman’s picture

I'm also having the same issue reported here, but comments are being imported fine. I'm using WP 3.2.1 and the latest Drupal release 7.9. I do have some custom content types setup in WP, but I've chose to only export posts in the WXR file. Categories and Tags are visible in the export file, but they don't get imported. This is a clean install of D7 with just a few modules enabled.

Could this be related to the way the categories/tags are being matched with a parent category/tag that may not yet exist at the time of import? I haven't traced the code fully, but I have noticed some references to parent categories, but I do not see any parent/child mappings in the WP export file. If you can point me in the right direction I may be able to resolve this issue and submit a patch.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this in my environment, tags/categories/comments import fine. Do you have term reference fields on your page and blog entry types, for the vocabularies you've mapped on the configuration page?

mikeryan’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

Also, please try the latest 7.x-2.x-dev release. I did fix one issue where category hierarchy wasn't coming through (e.g., the Jazz category, a subcategory of Music, was coming through at the top level - it's now properly parented).

nuez’s picture

ive used the latest dev versions of migrate and wordpress_migrate and experiencing the same issue.

my drupal node type has a term field (autocomplete) called field_tag, the wordpress file has for example

	<category domain="post_tag" nicename="xxx"><![CDATA[xxx]]></category>
		<category domain="post_tag" nicename="yyy"><![CDATA[yyy]]></category>
		<category domain="category" nicename="zzz"><![CDATA[zzz]]></category>
		<category domain="post_tag" nicename="xyz"><![CDATA[xyz]]></category>
mikeryan’s picture

For people seeing this problem, are the categories and tags themselves failing to migrate (i.e., not showing up in the vocabularies you assigned on the Configuration page), or are they getting created but just not assigned to the nodes?

Thanks.

essenceofginger’s picture

Hey Mike,

I'm seeing it. Using latest versions of Migrate, Migrate Extras, Wordpress Migrate.

XML file definitely includes tags and categories, I've uploaded the sample I'm using (one blog post in the file, with five comments) here.

Results: attached.
[edited: didn't realise how wide the images were when included inline!]

nuez’s picture

same here, the log says:

Processed 0 (0 created, 0 updated, 0 failed, 0 ignored) in 0.1 sec (0/min) - done with 'ElPartoEsNuestroCategory'

thanks!

mikeryan’s picture

Ah, the categories and tags aren't defined in your export file. Something like this is in the files I've worked with, before the first <item> tag:

	<wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>music-slug</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Music]]></wp:cat_name><wp:category_description><![CDATA[This is a music category]]></wp:category_description></wp:category>
	<wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
	<wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>jazz-slug</wp:category_nicename><wp:category_parent>music-slug</wp:category_parent><wp:cat_name><![CDATA[Jazz]]></wp:cat_name><wp:category_description><![CDATA[All about Jazz]]></wp:category_description></wp:category>
	<wp:tag><wp:term_id>7</wp:term_id><wp:tag_slug>baseball-slug</wp:tag_slug><wp:tag_name><![CDATA[Baseball]]></wp:tag_name><wp:tag_description><![CDATA[All about baseball]]></wp:tag_description></wp:tag>
	<wp:tag><wp:term_id>5</wp:term_id><wp:tag_slug>sports-tag</wp:tag_slug><wp:tag_name><![CDATA[Sports]]></wp:tag_name><wp:tag_description><![CDATA[All about sports]]></wp:tag_description></wp:tag>

Did you choose to exclude categories and tags when you exported?

essenceofginger’s picture

Aha. Gotcha. I chose to export only Posts - that were Published (as opposed to 'All content' on /wp-admin/export.php). Looking at the XML file that produces, those terms are now included.

However, I'm not sure I want to export all content... I only want published posts! ;) Or does Wordpress Migrate respect WP's published status? I don't particularly want Menu Items either...

Looks like it's a WP bug rather than this module; the 'export posts only' option should include the terms.

One other point - I don't understand how to use the Drush command... and if I try to import the XML file produced by the 'all content' export function in WP without it, Wordpress Migrate crashes out halfway through...

mikeryan’s picture

Assigned: Unassigned » mikeryan
Category: bug » feature
Status: Postponed (maintainer needs more info) » Active

wordpress_migrate does set the Drupal status appropriately based on the WP value.

Actually, it should be a simple matter to enabling "lazy-creation" of tags and categories - i.e., have any that are referenced by the content get created if they're not already there. I'll look into that.

As for the drush command, I've made a lot of changes regarding arguments to the migrations, I don't doubt I've broken that. A matter for a separate issue...

vacholino’s picture

I am having the same problem. This worked in the past but stopped working for some reason. I don't know if it's related to any module upgrades or not. Also, the wordpress migrate panel does not load when I have "migrate extras" enabled. I just get a blank page.

The import runs sucessfully and imports all blog posts and tags, but it does not map it. I can find the tags but they are not mapped to the posts.

Is this because I have migrate extras disabled?

Any suggestions on how I can get this working? Thanks!

mikeryan’s picture

@vacholino: Please read all comments above. Are your categories and tags defined at the top of the export file? If not, per comment 11, we need to implement "lazy-creation" of categories and tags, and that is not yet done (it turns out to be a bit trickier than expected).

mikeryan’s picture

Sorry, I didn't notice at first that you said the tags are actually being created, but just not added to your posts. You have verified that on the Wordpress configuration page that you are assigning the tags and categories to vocabularies that are attached to the destination node types?

Thanks.

dmb2168’s picture

Category: feature » bug

I'm having the same problem here. All my tags are being created and imported, and my content type has been assigned the vocabularies that my wordpress tags are being dumped into, but none of them are mapping.

Also, my wordpress categories are being imported, but only mapping some of the time. Only about 75% of posts get mapped to their corresponding category, and none of them are being mapped to tags.

Does it have anything to with the fact that in the WXR the tags are wrapped in CDATA[[]] brackets?

thanks

mikeryan’s picture

Status: Active » Fixed

Thanks @vacholino for the sample, it's fixed now...

dmb2168’s picture

I've just downloaded the update version of the module and for me my tags are not being mapped to any posts still..

dmb2168’s picture

Status: Fixed » Active

Sorry to keep spamming everyone but I really am hoping to get this issue with tagging sorted out! Here is a sample post from my WXR file:

<title>New spins on old favorites</title>
		<link>http://mysite.com</link>
		<pubDate>Wed, 03 Mar 2010 17:06:29 +0000</pubDate>
		<dc:creator><![CDATA[my author]]></dc:creator>
		
		<category domain="tag"><![CDATA[CCSC]]></category>

		<category domain="tag" nicename="ccsc"><![CDATA[CCSC]]></category>

		<category domain="tag"><![CDATA[chicken and rice]]></category>

		<category domain="tag" nicename="chicken-and-rice"><![CDATA[chicken and rice]]></category>

		<category domain="tag"><![CDATA[cu global health]]></category>

		<category domain="tag" nicename="cu-global-health"><![CDATA[cu global health]]></category>

		<category domain="tag"><![CDATA[facebook]]></category>

		<category domain="tag" nicename="facebook"><![CDATA[facebook]]></category>

		<category domain="tag"><![CDATA[lerner hall]]></category>

		<category domain="tag" nicename="lerner-hall"><![CDATA[lerner hall]]></category>

		<category domain="tag"><![CDATA[panama]]></category>

		<category domain="tag" nicename="panama"><![CDATA[panama]]></category>

		<category domain="tag"><![CDATA[primal scream]]></category>

		<category domain="tag" nicename="primal-scream"><![CDATA[primal scream]]></category>

		<category domain="tag"><![CDATA[sophomore scream]]></category>

		<category domain="tag" nicename="sophomore-scream"><![CDATA[sophomore scream]]></category>

		<category><![CDATA[Spectrum]]></category>

		<category domain="category" nicename="spectrum"><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">mysite</guid>
		<description></description>
		<content:encoded><![CDATA[In case you missed it:



<strong>NOT THE PRIMAL SCREAM</strong>: CCSC hopes that tonight at 9:30 p.m., sophomores will congregate on Low Steps for the first annual Sophomore Scream to <a href="http://www.facebook.com/event.php?eid=316203973458">shout their declared majors into the night sky.</a> Good news: funnel cake, hot chocolate, just long enough for an adequate study break. Bad news: There's a good chance sophomores are shouting empty words into the cosmos—they'll change their majors four times before graduation anyway. [<a href="http://www.facebook.com/event.php?eid=316203973458">Facebook</a>]



<strong>NOT LAST WEEK'S CHICKEN AND RICE</strong>: Just in case you were the 201st person at last week's event or can still feel the easy flow of blood through your arteries without evidence of clogging, CU Global Health is still trying to raise money to go to Panama. Chicken and Rice, the infamous halal cart usually situated at 53rd and Sixth, <a href="http://www.facebook.com/event.php?eid=10150125446170057">will be in Lerner from 8-9 p.m. tomorrow</a> (Thursday, March 4). [<a href="http://www.facebook.com/event.php?eid=10150125446170057">Facebook</a>] ]]></content:encoded>
		<excerpt:encoded><![CDATA[]]></excerpt:encoded>
		<wp:post_id>1074</wp:post_id>
		<wp:post_date>2010-03-03 12:06:29</wp:post_date>
		<wp:post_date_gmt>2010-03-03 17:06:29</wp:post_date_gmt>
		<wp:comment_status>open</wp:comment_status>
		<wp:ping_status>open</wp:ping_status>
		<wp:post_name>new-spins-on-old-favorites</wp:post_name>
		<wp:status>publish</wp:status>
		<wp:post_parent>0</wp:post_parent>
		<wp:menu_order>0</wp:menu_order>
		<wp:post_type>post</wp:post_type>
		<wp:post_password></wp:post_password>
		<wp:is_sticky>0</wp:is_sticky>
								<wp:postmeta>
		<wp:meta_key>jd_tweet_this</wp:meta_key>
		<wp:meta_value><![CDATA[yes]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>_edit_lock</wp:meta_key>
		<wp:meta_value><![CDATA[1313879630]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>_edit_last</wp:meta_key>
		<wp:meta_value><![CDATA[14]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>tagbar</wp:meta_key>
		<wp:meta_value><![CDATA[building community]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>postGuestAuthor</wp:meta_key>
		<wp:meta_value><![CDATA[Elyssa Goldberg]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>postThumb</wp:meta_key>
		<wp:meta_value><![CDATA[1080]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>postThumbCaption</wp:meta_key>
		<wp:meta_value><![CDATA[Wikimedia Creative Commons]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>wp_jd_target</wp:meta_key>
		<wp:meta_value><![CDATA[http://spectrum.columbiaspectator.com/spectrum/new-spins-on-old-favorites]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>wp_jd_bitly</wp:meta_key>
		<wp:meta_value><![CDATA[http://bit.ly/aDfmoI]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>_jd_tweet_this</wp:meta_key>
		<wp:meta_value><![CDATA[]]></wp:meta_value>
		</wp:postmeta>
				<wp:postmeta>
		<wp:meta_key>shorturl</wp:meta_key>
		<wp:meta_value><![CDATA[http://spc.me/zRhemH]]></wp:meta_value>
		</wp:postmeta>
mikeryan’s picture

The problem was that WXR version 1.0 used a domain of "tag", rather than 1.1's "post_tag", to identify tags within articles. Committed a fix.

Leaving open - I still want to implement lazy-creation of terms when the tags and categories aren't defined up top.

hekele’s picture

I was having the same problem :-) But I have just downloaded the latest dev version without any effect.

I changed this line in the file wordpress_source.inc
from:
else if ($domain == 'post_tag') {
to:
else if ($domain == 'post_tag' || $domain == 'tag') {

Mike, thanks a million for your work on all the incredible migration modules :-)

vacholino’s picture

did that fix it?

vacholino’s picture

Yes, check this out: http://content.screencast.com/users/vachik/folders/Jing/media/de66e77e-5...

They are getting imported, just not mapped. Any idea? Really want to get this working. Thanks!!

vacholino’s picture

StatusFileSize
new68.75 KB

Check this screen dump. Can it be that I am missing modules that migrate and migrate wordpress uses to port over the tags?

This is my migrate config page: http://screencast.com/t/qC2gWoQUuHr

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

@vacholino: The extract from your dump I'm working from imports fine using the current wordpress_migrate code - the tags and categories are assigned to the blog entries. Looking at your configuration screen, the one thing I would ask is if you're positive you have taxonomy term fields for your Tags and Category vocabularies on the Article content type?

vacholino’s picture

@Mikeryan: After uninstalling all the related modules and re-installing... I am no longer having that issue.

Thanks for the support!

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

Glad you got it going!

nuez’s picture

I hate to be the one reopening this issue, but it seems that its still not fixed. Tried to import part of a blog, everything importing fine, with latest dev versions of all modules, except for the categories and tags.

I´ve created the fields and the taxonomy terms, tried it on a clean D7 install.

Thanks!

Log:

Processed 0 (0 created, 0 updated, 0 failed, 0 ignored) in 0 sec (0/min) - done with 'ElPartoEsNuestroCategory'
Processed 0 (0 created, 0 updated, 0 failed, 0 ignored) in 0 sec (0/min) - done with 'ElPartoEsNuestroTag'

This is part of the file.

<rss version="2.0"
	xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:wp="http://wordpress.org/export/1.2/"
>
<wp:wxr_version>1.2</wp:wxr_version>	<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>http://wordpress.com/</wp:base_site_url>
<wp:base_blog_url>http://blogelpartoesnuestro.com</wp:base_blog_url>
<wp:post_id>6666</wp:post_id>
<wp:post_date>2012-03-07 14:16:42</wp:post_date>
<wp:post_date_gmt>2012-03-07 14:16:42</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>el-hospital-universitario-central-de-asturias-huca-trabaja-por-mejorar-y-atender-bajo-las-recomendaciones-internacionales</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="asociacion"><![CDATA[ASOCIACION]]></category>
<category domain="post_tag" nicename="atencion-al-parto-asturias"><![CDATA[Atención al parto Asturias]]></category>
<category domain="post_tag" nicename="encuesta-atencion-materna-y-neonatal-asturias"><![CDATA[Encuesta atención materna y neonatal Asturias]]></category>
<category domain="post_tag" nicename="huca"><![CDATA[HUCA]]></category>
<category domain="category" nicename="leer-entre-lineas"><![CDATA[Leer entre líneas]]></category>
<category domain="post_tag" nicename="parir-en-el-huca"><![CDATA[parir en el HUCA]]></category>
mikeryan’s picture

The key would appear to be here:

<wp:wxr_version>1.2</wp:wxr_version> <wp:wxr_version>1.2</wp:wxr_version>

First off, it's pretty funky that there are two copies of the wxr_version element, that might be messing things up. Secondly, this is the first I've seen of wxr_version 1.2, I'll open a separate issue for handling that.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

narcissus921’s picture

I also hate to reopen this issue, but I've been attempting an import, with limited success.

I've got the posts and comments to carry over correctly, but no term data is being imported in. I'm using WXR version 1.1, and can provide a sample of the import.

<category domain="post_tag" nicename="insurance"><![CDATA[insurance]]></category>
		<category domain="post_tag" nicename="member"><![CDATA[Member]]></category>
		<category domain="category" nicename="3-presidents-corner"><![CDATA[President's Corner]]></category>
		<category domain="post_tag" nicename="safety"><![CDATA[Safety]]></category>
		<category domain="post_tag" nicename="tenant-education"><![CDATA[Tenant Education]]></category>
		<category domain="post_tag" nicename="tenants"><![CDATA[tenants]]></category>

I've got the vocabularies created, with no terms in there, and the proper vocabularies pathed correctly in the import, Tags to my Tag vocabulary, Categories to my Category vocabulary.

Do I need to create the terms in the vocabularies prior to the import?

Thanks for the help!