WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 17 months ago

#17750 closed defect (bug) (invalid)

Export formats tags and categories incorrectly

Reported by: ipstenu Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1.3
Component: Export Keywords: reporter-feedback
Focuses: Cc:

Description

<category domain="category" nicename="featured"><![CDATA[Featured]]></category>

vs

<wp:category><wp:category_nicename>featured</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Featured]]></wp:cat_name></wp:category>

Basically I ran an export on a WP MultiSite install (3.1.3) and then imported it to a second site on the same network (theme testing the easy way!) and ... yeah. Nothing worked. Looked at the XML from the test unit and it was different for cats and tags, so I regex'd that over and it was ... well I did it wrong, but the point is the export is wrong which screws things up.

Every time I export from MultiSite I get this.

Change History (9)

comment:1 duck_3 years ago

  • Keywords reporter-feedback added

I'm not sure what you're saying is wrong here. That looks as expected to me. The first style <category> elements are used within post <item>s to show a relationship between term and post. The second style is used within the <channel> element at the top of the file to just register a category (or tag or other term). Could you clarify what you believe to be screwed up about your export?

I also just double checked an import from one site to another on an MS installation and it worked alright for me.

comment:2 follow-up: ipstenu3 years ago

"The second style is used within the <channel> element at the top of the file to just register a category (or tag or other term)."

Aha. Then I think the problem is those were OMITTED from my export. I only exported posts, and none of those were there,

comment:3 in reply to: ↑ 2 duck_3 years ago

Replying to ipstenu:

Aha. Then I think the problem is those were OMITTED from my export. I only exported posts, and none of those were there,

That should still work as expected. Since you're exporting only posts you miss out on all cats, tags and terms, and only get those which are attached to posts that haven't been filtered out. So the <category> style elements will (or at least should) still get imported.

My retesting just now to double check confirmed this was fine for me. MS export filtered on posts only (sub-filters, e.g. specific category, were left at default) and imported to another site on the network.

Nothing worked

Could you expand that original point please. I took that to mean no content whatsoever was imported.

comment:4 ipstenu3 years ago

Sorry. That was crap reporting.

When I export/import, my posts come just fine, but NO tags or categories are imported. None. Not a ONE. They're all Uncategorized. Every last one. Which is maddening. I did it three times, same results.

comment:5 Ipstenu3 years ago

Update - When I export FROM a MultiSite to a new SingleSite, it all works just fine. So if anything, something is hinky with importing TO a MultiSite.

comment:6 Ipstenu3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Closing this myself. I've tried like hell to recreate this consistently and I cannot. So PEBUAK. Or user and coffee. Who knows. It's not reproducable and as such, invalid.

comment:7 SergeyBiryukov3 years ago

  • Milestone Awaiting Review deleted

comment:8 follow-up: imshashank17 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

WordPress.com exports posts with a tag of
"<category domain="category" nicename="travel"><![CDATA[Travel]]></category>"

This format isn't recognised by 3.0.1 wordpress. It needs the category in this format:
"<category><![CDATA[Travel]]></category>"

So the quick way to fix this is open the xml export file from wordpress.com in a global search and replace in your favourite word/text editor that can support wildcards. eg
Just search for "<category*"> and replace it with "<category>" and then do the import into your wordpress.org blog.

comment:9 in reply to: ↑ 8 duck_17 months ago

  • Resolution set to invalid
  • Status changed from reopened to closed

Replying to imshashank:

I think that format should work fine with WordPress >= 3.0.0 as long as you're using the import plugin version 0.3 or later (later being better). Please update to the latest version of WordPress though.

Re-closing as unrelated to this ticket anyway.

Note: See TracTickets for help on using tickets.