Smush returns errors while smushing images with old path

When bulk Smushing images Smush returns errors:

Could not find /home/flyingcr/public_html/obrag/wp-content/uploads/2007/10/march.jpg

/home/flyingcr/public_html/obrag/ is part of the old images path, from old server.

On live chat we tried to change upload_path in database (in wp_options table) but it did not help.
There was search performed in database for that path part flyingcr but it wasn't found.

Permissions of the directory "uploads" is 755.

Support access is open.

  • Nithin

    Hi patty Jones,

    Hope you are doing good today. :slight_smile:

    Could you please share us your credentials so that we could give a closer look, and see where this path is being called in your system, it might be related to one of the folders, or a wrong path in database.

    You can send credentials by using our secure contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -cPanel, or Database access(PHPMyAdmin)
    -link back to this thread for reference
    -any other relevant urls

    Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • Nithin

    Hi patty Jones,

    Sorry for the delay in getting back to you, it's been a busy week. Thank you for sending in the credentials, I checked your website, and I could see the issue. The old servers image path is still present in your database that's causing this issue.

    I was able to find it in wp_postmeta table. What you'll have to do is replace the old path with the new path, and it should work fine.

    I tested this with earlymorning7-23-07.jpg image which was the 1st image link that was in error list when we tried to bulk smush it.

    So, I replaced the server path manually in your database for the mentioned image, ie

    From:
    /home/flyingcr/public_html/obrag/wp-content/uploads/2007/10/earlymorning7-23-07.jpg

    To:
    /home/obragorg/public_html/wp-content/uploads/2007/10/earlymorning7-23-07.jpg

    Once done, when I clicked the bulk smush button, the above image got smushed, as seen in the following screenshot.

    However, I was able to notice that once smushed, the thumbnail got corrupted due to old server path, and it was showing a blank image as above screenshot.

    To resolve that, I had to install Regenerate Thumbnails plugin in your website, and clicking the Regenerate Thumbnails link made the thumbnail image appear.

    However, there are about 5000 image paths in your database which is pointing to the old server path. What you'll have to do is install Search and Replace plugin, and replace the old path with the new one.

    That's, you'll have to add the following old path in the search field:
    /home/flyingcr/public_html/obrag/

    And in the replace field, you'll have to add the new server path:
    /home/obragorg/public_html/

    Once done, this should make Bulk Smush find the correct image path. I could see you already have Search and Replace plugin installed, but it doesn't work because you are using PHP 5.3. The plugins needs a minimum PHP 5.4 to work.

    Would recommend you to get in touch with your host, and ask them to update PHP to minimum 5.6. Once done, you can replace the server path, and bulk smush should work fine, and it'll also eliminate any other issues in future when it comes to old server path.

    Would highly recommend you to create a backup, before using Search and Replace plugin, because any error in modifying the database, could lead to more anomalies. You can use a plugin like Snapshot for creating backups.

    I hope this helps. Please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Best Regards,
    Nithin

  • patty Jones

    I did update PHP to 5.6, although I did the search and replace through phpMyAdmin. I am now regenerating the thumbnails month by month, we have 18000 images and don't need to regen thumbnails for all of them. Nice thing is that Smush processes them at the same time. I tried the bulk smush and haven't seen any errors yet.

    Thank you for your help with this! So far your fix is working like a charm!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.