1

I am attempting to move all content from an existing WP installation, to a fresh installation.

I export all content, using the Tools > Export feature.

When I attempt to import into the new installation, I get the error Failed to import post tag.

It would seem none of the tags can be imported. I have no idea why, and haven't managed to find info about this online.

Here is a sample of the tag entries in the XML file:

<wp:tag>
    <wp:term_id>31</wp:term_id>
    <wp:tag_slug><![CDATA[accounts]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Accounts]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>148</wp:term_id>
    <wp:tag_slug><![CDATA[acl]]></wp:tag_slug>
    <wp:tag_name><![CDATA[ACL]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>191</wp:term_id>
    <wp:tag_slug><![CDATA[ad-blocking]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Ad-blocking]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>212</wp:term_id>
    <wp:tag_slug><![CDATA[adblock]]></wp:tag_slug>
    <wp:tag_name><![CDATA[adblock]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>231</wp:term_id>
    <wp:tag_slug><![CDATA[address-book]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Address Book]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>28</wp:term_id>
    <wp:tag_slug><![CDATA[adobe]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Adobe]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>213</wp:term_id>
    <wp:tag_slug><![CDATA[advertising]]></wp:tag_slug>
    <wp:tag_name><![CDATA[advertising]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>98</wp:term_id>
    <wp:tag_slug><![CDATA[alternative-apps]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Alternative Apps]]></wp:tag_name>
</wp:tag>
<wp:tag>
    <wp:term_id>141</wp:term_id>
    <wp:tag_slug><![CDATA[android]]></wp:tag_slug>
    <wp:tag_name><![CDATA[Android]]></wp:tag_name>
</wp:tag>

It all looks find to me.

Does anyone have any suggestions?

Thanks.

UPDATE I discovered the tags had in fact imported (well, just two unused tags were missing on the receiving site... perhaps because they were unused the export/import ignored them?). Otherwise, all tags and categories imported, despite the error message suggesting the tags failed.

I also discovered all featured images were missing (no reference to them in the Posts table, or incorrect references — I forget which, but think it was the prior).

  • When I looked through the receiving database in more detail, it appeared all that was missing was the featured image data. Rather than messing around with the XML any further, simply exported the tables for posts, postmeta, and comments (I had to do all three because replacing Posts meant the Post IDs no longer matched with the other two tables. This seems to have resolved the issue, and completed the migration. Oddly, even through the error I got (consistently) during the XML import referred to the Tags, as far as I could tell, all tag data migrated without a hitch. – omega33 Aug 24 '16 at 16:18
  • I've never had the WordPress importer actually work with media. Everything else it does a fine job of but it feels like the import media option is just a checkbox that never got built out in the backend. – mrben522 Dec 20 '18 at 21:10
0

Save the xml snippet to a xml file. And after seeing the message Failed to import post tag (after importing all the posts) import this file. It will import all the tags.

Here is your xml-

<?xml version="1.0" encoding="UTF-8"?>
<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/">
    <channel>
        <wp:wxr_version>1.2</wp:wxr_version>

        <wp:tag>
            <wp:term_id>31</wp:term_id>
            <wp:tag_slug><![CDATA[accounts]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Accounts]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>148</wp:term_id>
            <wp:tag_slug><![CDATA[acl]]></wp:tag_slug>
            <wp:tag_name><![CDATA[ACL]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>191</wp:term_id>
            <wp:tag_slug><![CDATA[ad-blocking]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Ad-blocking]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>212</wp:term_id>
            <wp:tag_slug><![CDATA[adblock]]></wp:tag_slug>
            <wp:tag_name><![CDATA[adblock]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>231</wp:term_id>
            <wp:tag_slug><![CDATA[address-book]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Address Book]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>28</wp:term_id>
            <wp:tag_slug><![CDATA[adobe]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Adobe]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>213</wp:term_id>
            <wp:tag_slug><![CDATA[advertising]]></wp:tag_slug>
            <wp:tag_name><![CDATA[advertising]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>98</wp:term_id>
            <wp:tag_slug><![CDATA[alternative-apps]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Alternative Apps]]></wp:tag_name>
        </wp:tag>
        <wp:tag>
            <wp:term_id>141</wp:term_id>
            <wp:tag_slug><![CDATA[android]]></wp:tag_slug>
            <wp:tag_name><![CDATA[Android]]></wp:tag_name>
        </wp:tag>
    </channel>
</rss>

Hope this one solves your problem.

  • Thanks. When I looked through the receiving database in more detail, it appeared all that was missing was the featured image data. Rather than messing around with the XML any further, simply exported the tables for posts, postmeta, and comments (I had to do all three because replacing Posts meant the Post IDs no longer matched with the other two tables. This seems to have resolved the issue, and completed the migration. Oddly, even through the error I got (consistently) during the XML import referred to the Tags, as far as I could tell, all tag data migrated without a hitch. Go figure. – omega33 Aug 24 '16 at 16:17
  • So now you're doing it by exporting the database, right ? – CodeMascot Aug 24 '16 at 18:39
  • Not exactly. Most of the transfer was done through the "failed" XML export/import. But because that "failed" ex/im didn't transfer the featured image attachment data, I dumped three tables to an SQL file, from the old DB, and then imported them into the new DB. So just three tables were exported from the database. The rest was handled by the XML process. – omega33 Aug 25 '16 at 1:29
  • I don't think it's a good idea. Some import done by XML and some by database import is a bad idea. Cause WordPress saves serialized data. Some XML and some database import could cause some error as well as data loss. By the way, I tested the above my answer code. It works pretty well. So if you accept the answer, it would be great. Thanks @inspirednz – CodeMascot Aug 25 '16 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.