WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] XML to WXR issue. (28 posts)

  1. ASWM_Will
    Member
    Posted 3 years ago #

    I think I've read about twenty threads on three different boards insisting that WXR and .XML are the same file format and .XML should be able to import without difficulty.

    I accept that WXR may be a type of XML, but it's not the type exported by WordPress under Management->Export.

    When I go to Tools->Import, and select the .XML file in question, I get the following error:

    Sorry, there has been an error.
    This does not appear to be a WXR file, missing/invalid WXR version number.

    The .XML file begins like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
    <!-- It contains information about your blog's posts, comments, and categories. -->
    <!-- You may use this file to transfer that content from one site to another. -->
    <!-- This file is not intended to serve as a complete backup of your blog. -->
    
    <!-- To import this information into a WordPress blog follow these steps. -->
    <!-- 1. Log into that blog as an administrator. -->
    <!-- 2. Go to Manage: Import in the blog's admin panels. -->
    <!-- 3. Choose "WordPress" from the list. -->
    <!-- 4. Upload this file using the form provided on that page. -->
    <!-- 5. You will first be asked to map the authors in this export file to users -->
    <!--    on the blog.  For each author, you may choose to map to an -->
    <!--    existing user on the blog or to create a new user -->
    <!-- 6. WordPress will then import each of the posts, comments, and categories -->
    <!--    contained in this file into your blog -->
    
    <!-- generator="wordpress/2.3.2" created="2011-04-06 16:14"-->
    <rss version="2.0"
            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.0/"
    >

    And ends like this:

    </channel>
    </rss>

    Which, I'm led to believe, is the correct structure.

  2. JonMorgan
    Member
    Posted 3 years ago #

    I just had exactly the same problem - I had an old WordPress 2.2 export and was getting the same error.

    I finally worked out how to solve it by doing an export of the 'Hello World' default post from a new installation of WP on my new server and seeing if it had a wxr version number in it. Which it did.

    If you paste the following line into your export file after the Language defining line in the <channel> section near the topyou should be good to go:
    <wp:wxr_version>1.1</wp:wxr_version>

    You may be able to put it elsewhere, but that's where it appeared in my new export and where it worked for me.

    Hope that helps.

  3. ASWM_Will
    Member
    Posted 3 years ago #

    Thank you, JonMorgan!

    That at least got it to swallow the .xml file. I then got a massive pile of 'failed to import' messages, but at least this is a new problem! :)

  4. akashik
    Member
    Posted 3 years ago #

    JonMorgan,

    Thanks! I've spent a few hours looking for a solution to this problem and now it's solved.

    The 'failed to import' errors I got were just for JPG images (about a dozen), so don't let that put anyone else off. Worked like a charm.

  5. fujiyamasurf
    Member
    Posted 2 years ago #

    JonMorgan!

    Thanks!

  6. leivajd
    Member
    Posted 2 years ago #

    hey @JonMorgan thanks, worked as a charm!

  7. ashlinixon
    Member
    Posted 2 years ago #

    I am trying to import from one WordPress 3.3 blog to another. My file already has <wp:wxr_version>1.1</wp:wxr_version> in it. Anyone else having issues using the importer with WordPress 3.3?

  8. sb_cole
    Member
    Posted 2 years ago #

    @ashlinixon, interesting coincidence of timing, but I too am having the same issue as well. I have a feeling this has to do with the WP Importer not being compatible with 3.3. I'm going to continue to look around and will post back here if I find a solution. Please do the same if you find out also. ;)

  9. ashlinixon
    Member
    Posted 2 years ago #

    @sb_cole Unfortunately I haven't found at great solution yet. I kind of think it has something to do with the WordPress Importer and the latest version of 3.3 as well. :\

  10. sb_cole
    Member
    Posted 2 years ago #

    I was able to successfully import it after reverting to WP 3.2.1. After doing so, I upgraded to 3.3 and everything is fine.

  11. phontary
    Member
    Posted 2 years ago #

    :-)

    i found a solution to this issue .. you can download any old wordpress version .. and replace all files via FTP uploader .. all files EXCEPT wp-config.php and wp-content folder

    and everything is going to be ok

    seems to be an issue with the importer plugin with 3.3 new update !! :-(

  12. gruffvaughan
    Member
    Posted 2 years ago #

    I'm also having this problem... Exporting from a 3.3 localhost version to a 3.3 server version. Wasn't expecting any issues, but the import/export function of 3.3 seems broken.

    How come this hasn't been flagged up and fixed yet? It's a pretty crucial function WordPress! Has ANYONE found a solution that doesn't involve re-installing WordPress to an older version?

  13. memuller
    Member
    Posted 2 years ago #

    Same issue here, on WP 3.3.

    Rolling back the WP version indeed works, but is very annoying, and I'm unwilling to perform it on large blog networks.

    I filled in a ticket about it with the bits of information here, let's see what happens.

  14. Gene
    Member
    Posted 2 years ago #

    I got hit with a similar situation.

    In my case, It turned out to be a file permission/ownership issue. It appears that the WP core functions the importer plugin uses to upload the file do not provide error reporting for an instance where the the uploads, latest year and month directories exist but WordPress doesn't have the ownership and permission to write the file to the latest month dir. In this particular case the error reporting falls back to the plugin and

    Sorry, there has been an error.
    This does not appear to be a WXR file, missing/invalid WXR version number.
    is the resulting error.

    So if it happens to you on a unix box... chown or chmod your latest month's directory and it may fix the import issue.

    Hope that helps.

  15. ralerin
    Member
    Posted 2 years ago #

    Thank you emhr.
    I'have solved the error with that solution!!

  16. serkankaya
    Member
    Posted 2 years ago #

    that worked for me as well thanks

  17. zepher
    Member
    Posted 2 years ago #

    Whad did you CHMOD the files? 775? Having a similar issue on install and think it's the permissions on the uploads folder.

  18. Gene
    Member
    Posted 2 years ago #

    Permissions and ownership will depend on your server set up. 775 worked for me in that case. You may need to chown and change the group two so WP can write to the directory.

  19. pmagony
    Member
    Posted 2 years ago #

    Thanks Emhr, your solution was exactly the issue.

  20. lament
    Member
    Posted 2 years ago #

    Hey all,

    Having this same problem. Updated to the latest WP, exported the .xml file, switched web hosts, and now trying to upload the xml file but getting:

    Sorry, there has been an error.
    This does not appear to be a WXR file, missing/invalid WXR version number

    PHP safe_mode is off.

    Do I have to re-create all the folders I had in the /uploads folder and chmod 755 them?

    Thanks for any help.

  21. Gene
    Member
    Posted 2 years ago #

    If your migrating the install to a new host you'll want to migrate the uploads folder or else you'll generate 404 errors if you had attached images to posts.

    Look here for help with permissions settings.
    http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress

  22. lament
    Member
    Posted 2 years ago #

    Yeah I know it would 404, but that's not the issue.

    I uploaded the folders, made sure they were writable.. but I'm still getting that error.

    XML shows:

    <wp:wxr_version>1.1</wp:wxr_version>

  23. Gene
    Member
    Posted 2 years ago #

    Does the current month folder exist and is it writeable by WP?
    wp-content/uploads/2012/01
    That's what my case was... If yes and your still stumped, you can aways debug the importer with:

    define( 'IMPORT_DEBUG', true );

    That'll give you a little better error reporting than what you get by default.

  24. lament
    Member
    Posted 2 years ago #

    Does the current month folder exist and is it writeable by WP?
    wp-content/uploads/2012/01

    Yes.

    Debug is showing:

    0:0 failed to load external entity "/var/www/vhosts/[site.com]/httpdocs/wp-content/uploads/site.wordpress.2012-01-27.xml_.txt"

    why is it appending _ after xml and .txt to it?

  25. loralang
    Member
    Posted 2 years ago #

    I was having the same problem and tried all the suggestion in the forums. I finally asked for help from my host and they turned off safe_mode for my site and it worked! Hallelujah!

  26. lament
    Member
    Posted 2 years ago #

    ^ mine's off but I'm still having this issue. :/

  27. proverbs31woman
    Member
    Posted 2 years ago #

    That worked for me. Thanks for sharing this. I was importing from 2.2.1 to 3.3.1. That worked and it even included images, pending comments and drafts.

  28. Roger Huston
    Member
    Posted 2 years ago #

    Hello,

    I found another way to fix the problem.

    I had the same problem with WordPress 3.3.1 both locally and in production. However, I am on Windows and my servers are both UNIX. For me, I used ultraedit, converted the .xml file from DOS to UNIX and it worked.

    - Roger

Topic Closed

This topic has been closed to new replies.

About this Topic