WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Media Importing Failure (17 posts)

  1. C-Sec Requisitions Officer
    Member
    Posted 2 years ago #

    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?

  2. Jauhari
    Member
    Posted 2 years ago #

    We got same problem... any solutions?

  3. cwulff
    Member
    Posted 2 years ago #

    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.).

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Have you tried checking your server's error logs?

  5. cwulff
    Member
    Posted 2 years ago #

    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.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

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

  7. cwulff
    Member
    Posted 2 years ago #

    Nope, they're not being uploaded at all.

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    Can you upload a random sample image?

  9. cwulff
    Member
    Posted 2 years ago #

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

  10. esmi
    Forum Moderator
    Posted 2 years ago #

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

  11. belindajohnstone
    Member
    Posted 2 years ago #

    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.

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  13. belindajohnstone
    Member
    Posted 2 years ago #

    Really? works perfectly.

  14. belindajohnstone
    Member
    Posted 2 years ago #

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

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

  15. esmi
    Forum Moderator
    Posted 2 years ago #

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

  16. belindajohnstone
    Member
    Posted 2 years ago #

    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

  17. esmi
    Forum Moderator
    Posted 2 years ago #

    Glad to hear that it's all working now. FWIW, there has been talk in the past of rewriting WordPress core to allow for relative urls but, so far, that hasn't happened.

Topic Closed

This topic has been closed to new replies.

About this Topic