• Resolved txantimedia

    (@txantimedia)


    I’m in the process of setting up a self-hosted site, migrating from WordPress.com. The site is IP-address-only right now, because DNS still points to the existing site on WordPress.com.

    I tried to Export and Import the site. It worked fine *except* for attachments. Those failed. So I copied the manually to wp-content/uploads/2012/some subdirs to replicate what is on WordPress.com. But the files don’t show up in the library.

    I don’t see a way to use the import tool to “point to” files already on the server. If I run the import again, will it pick that up and edit the right tables in the db? Or am I going to have to do this manually?

Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter txantimedia

    (@txantimedia)

    The .xml export file is about 3.3MB.

    I’m not familiar with allocation limits. Just a sec….

    From the php.ini file:
    post_max_size = 20M
    upload_max_filesize = 20M
    max_file_uploads = 100

    Thread Starter txantimedia

    (@txantimedia)

    Here’s the results of the latest attempt:

    Media “AustraliapleasepleasebeCareful” already exists.
    Failed to import Media “trayvon-martin-sao-girl-interview”
    Failed to import Media “TheseAreMyCredentials”
    Failed to import Media “SocialSecurityReformAct”
    Failed to import Media “Afghanistan”
    Failed to import Media “Afghanistan”
    Failed to import Media “anniversary”
    Failed to import Media “6182012_64519_0”
    Failed to import Media “3105-Oops1”
    Failed to import Media “freedom_scale”
    Failed to import Media “image”
    Failed to import Media “image2”
    Failed to import Media “image3”
    Failed to import Media “image4”
    Failed to import Media “image5”
    Failed to import Media “image6”
    Failed to import Media “Reagan1”
    Failed to import Media “Reagan2”
    Failed to import Media “birth-certificate-long-form”
    Failed to import Media “Trayvon_shooting_timeline”
    Failed to import Media “100_0714 (WinCE)”
    Failed to import Media “100_0716 (WinCE)”
    Failed to import Media “100_0717 (WinCE)”
    Failed to import Media “100_0718 (WinCE)”
    Failed to import Media “100_0719 (WinCE)”
    Failed to import Media “100_0720 (WinCE)”
    Failed to import Media “Singleton1”
    Failed to import Media “Singleton2”
    Failed to import Media “Serino1”
    Failed to import Media “Serino2”
    Failed to import Media “Serino3”
    Failed to import Media “George-Zimmerman-Treyvon-Martin-911-Call”
    Failed to import Media “Zimmerman_Non-emergency_call”
    Failed to import Media “Zimmerman_Non-emergency_call_annotated”
    Failed to import Media “Zimmerman_Non-emergency_call_annotated”
    Failed to import Media “Zimmerman_Non-emergency_call”
    Failed to import Media “Zimmerman_Non-emergency_call_annotated”
    Failed to import Media “audio_interview_0227”
    Failed to import Media “audio_interview_0229_1”
    Failed to import Media “audio_interview_0229_2”
    Page “About” already exists.
    Post “Blogging again” already exists.
    Failed to import Media “audio_statement_0226_1”
    Failed to import Media “audio_statement_0226_2”
    Failed to import Media “George-Zimmerman-Treyvon-Martin-911-Call”
    Failed to import Media “Zimmerman_Non-emergency_call_annotated”
    Failed to import Media “Serino3”
    Failed to import Media “audio_interview_0229_3”
    Failed to import Media “Possible path for TM”
    Failed to import Media “Zimmerman_Non-emergency_call_annotated”
    Failed to import Media “Initial_path_of_TM”
    Failed to import Media “HSFLGL-12-B-00003_Step_1_Technical_searchable”
    Failed to import Media “father_and_son”
    Post “A Cautionary Tale For Americans” already exists.
    Failed to import Media “blackandtan”
    Post “John Lott Is Right” already exists.
    Failed to import Media “John Lott Is Right”
    Failed to import Media “1961-2012Non-farm_employment”
    Failed to import Media “1961-2012Non-farm_employment”
    Failed to import Media “CrazyGrandmaCrazyPhotos”

    Thread Starter txantimedia

    (@txantimedia)

    I think I’ve found the problem:

    [Tue Sep 18 13:55:40 2012] [error] [client 129.112.250.225] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 236852299 bytes) in /usr/local/www/wordpress/wp-includes/class-http.php on line 1154, referer: https://216.58.158.174/wp-admin/admin.php?import=wordpress&step=1&_wpnonce=4f42501d8f

    Guess I need to bump size up to 100MB.

    Thread Starter txantimedia

    (@txantimedia)

    Well, that didn’t work. I increased the upload_max_filesize to 2G, and it still gave me the same error. After reading this article I installed WP Cleanup and ran it. Now I’m testing again.

    Thread Starter txantimedia

    (@txantimedia)

    Thanks. That finally solved the problem.

    The solution was to add a define to the wp-config.php file:
    define(‘WP_MEMORY_LIMIT’, ‘500M’);

    That overrides the constant set in wp-includes/default-constants.php:
    if ( ! defined( ‘WP_MAX_MEMORY_LIMIT’ ) ) {
    define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ );
    }

    Which is what causes the error message:
    PHP Fatal error: Allowed memory size of 268435456 bytes exhausted

    Setting a memory limit in php.ini doesn’t do a thing if the file sizes are larger than 256MB (which one of mine was.)

    It seems like the import tool should have the capability to reject a single file and move on to the next one, but instead it bails on the error. It’s bad programming, but it’s not my problem now.

    Thread Starter txantimedia

    (@txantimedia)

    After further testing, this is untrue. define(‘WP_MEMORY_LIMIT’, ‘500M’); overrides the default constant of 32M (multisite) or 64M (single site). You also have to override the define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ ); by adding a second define to the wp-config.php file of define( ‘WP_MAX_MEMORY_LIMIT’, ‘500M’ );

    That solves the problem. You can mark this as resolved.

    Glad to hear that you got it sorted. ??

    Thread Starter txantimedia

    (@txantimedia)

    Thanks for you help and for pointing me in the right direction.

    My apologies for resurrecting this topic.

    I’ve just recently been faced with the need to move a wordpress.com domain to a private host and despite all my efforts, the Import tool would constantly fail on importing certain media, which were nothing but reasonably-sized pictures.

    Long story short, after trying all the above-mentioned tricks related to increasing available memory and whatnot and failing everytime, I started analyzing the exported XML, particularly the failing sections.

    In doing that, I noticed certain links within each troublesome object section were regular HTTP links, while others were HTTPS. On a hunch, I used search and replace throughout the entire XML, replacing all occurences of HTTPS with HTTP.

    Immediately after that, the import succeeded without any errors whatsoever. All media files that previously failed to download are now in their respective subfolders. This has been tested in InstantWP, using both WordPress 3.4.2 and 3.5 and they both yielded positive results.

    I hope this would be of help to others having troubles importing their domains. Thank you.

    I have likewise been having quite a headache around failed import of images from old to new site. Here is some information that may be relevant for others. After much chat support with my new hosting service – one.com – I learned that this service does not support “one click install” for WordPress. Furthermore, XML import is not working — or at least only partially. The text content for all my posts imports successfully. All images fail.

    one.com: Oh you are importing XML
    one.com: to transfer your wordpress?
    one.com: Unfortunately, that is not working on our servers
    one.com: You need to import your wordpress files manually using FTP
    one.com: to your one.com account
    one.com: and then import the .sql file via Control panel > Phpmyadmin from your previous host
    you: oh my… yes, i have tried to use the simple, user-friendly functionality in WordPress
    one.com: Unfortunately, importing via XML is not working

    After further testing, this is untrue. define(‘WP_MEMORY_LIMIT’, ‘500M’); overrides the default constant of 32M (multisite) or 64M (single site). You also have to override the define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ ); by adding a second define to the wp-config.php file of define( ‘WP_MAX_MEMORY_LIMIT’, ‘500M’ );

    That solves the problem. You can mark this as resolved.

    Just so everyone knows, txantimedia‘s solution above worked for me! So grateful to have found this.

    Thanks!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Import of attachments fails’ is closed to new replies.