WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Media Importing Failure

[Resolved] Media Importing Failure

  • C-Sec Requisitions Officer

    @c-sec-requisitions-officer

    Was trying to import a WordPress export file, and then I got the following error:

    Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/xxxxxxxxx/public_html/wp-content/plugins/wordpress-importer/wordpress-importer.php on line 91

    Failed to import Media ___
    Failed to import Media ___
    Failed to import Media ___

    Failed to import Media ___

    Where “___” stands for every piece of media I uploaded. In short, I can’t migrate any image. Why is this happening and how do you suppose it can be solved?

    I attempted to upload the “uploads” folder right away but the “media” module doesn’t recognise the content and the relations with the individual posts are lost, of course.

    As a last resort I was thinking to just re-upload everything, but then the URL structure will be broken (everything will be recorded as though they are uploaded this month). I can try to use custom URL path to match the original month but that seems cumbersome. Perhaps there’s a plugin for this?

Viewing 15 replies - 1 through 15 (of 16 total)
  • We got same problem… any solutions?

    Same problem here trying to go from a wordpress.com account to a wordpress.org one.

    Permissions on the upload folder and on wp-content (temporarily) is 777. Logged into both sites in the same browser. Imports posts no problem, but all of the media fail to upload.

    Not sure where else to look. Is there an error log that might tell me something more specific?

    Incidentally “Failed to upload media” isn’t exactly a helpful error message. It would be nice if WordPress said what in the process had failed (didn’t find site, didn’t find image, didn’t have permission, etc.).

    esmi

    @esmi

    Forum Moderator

    Have you tried checking your server’s error logs?

    Yeah, there’s nothing there aside from “Directive ‘magic_quotes_gpc’ is deprecated in PHP 5.3 and greater” which I don’t think is related based on my searching.

    esmi

    @esmi

    Forum Moderator

    Are the images being uploaded to the correct folder in wp-content?

    Nope, they’re not being uploaded at all.

    esmi

    @esmi

    Forum Moderator

    Can you upload a random sample image?

    No problem adding files via the media library uploader or the media uploader in the post editor.

    esmi

    @esmi

    Forum Moderator

    That sounds like the images are either missing or being blocked. Can you view them using a browser?

    I been having the same problem, but just spent some time doing a test import, this time I did not copy the uploads folder via FTP before the import, amazingly it worked.

    The images are all still attached to each post, and you just have to replace the contents of the uploads via ftp afterwards and they all appear exactly as they should.

    As all my images were in galleries, the other thing I did to ensure the path would be correct is I did a search and replace on the xml file for http://mysite.com/wp-content/uploads/ and replaced with /wp-content/uploads/

    Hope this help.

    I’m happy, it’s my first solution I’ve posted.

    esmi

    @esmi

    Forum Moderator

    the other thing I did to ensure the path would be correct is I did a search and replace on the xml file for http://mysite.com/wp-content/uploads/ and replaced with /wp-content/uploads/

    No. No No! All urls in WordPress should be full (absolute). Not relative.

    Really? works perfectly.

    OK, I could change to http://newsite.com/wp-content/uploads/

    But isn’t it better to reduce the dns lookups?

    esmi

    @esmi

    Forum Moderator

    Short answer: WordPress needs absolute urls. Relative urls work unpredictably (if at all).

    OK, Thanks, I have now changed my strategy completely then… While the above technique seemed to work at first, the gallery images were not imported as thumbnails, the sizing was all wrong.

    I did a second test importing through phpMyAdmin and images are still attached to posts and galleries are still in place.

    And I left all paths as absolute.

    Thanks Esmi

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] Media Importing Failure’ is closed to new replies.