• Resolved ludomania007

    (@ludomania007)


    Hello,

    I just move my website from local to anotner server. The issue is that, when i try to compress files, i got an error message of could not file file for image but i noticed that the path for the image is still the absolute path from the previous server. How to fix this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support vupdraft

    (@vupdraft)

    You will need to update the URL of the moved images with a tools such as this:  https://ww.wp.xz.cn/plugins/better-search-replace/

    Thread Starter ludomania007

    (@ludomania007)

    You are talking about URL, i’m talking about PATH, the path on the server. I move from a local windows pc so the path is like C:\laragon\www\xxxxx in linux it coul be /var/www/html …
    I’m not talking about the url, i already changed the url that is why the website is available. Now i have a plugin that should compress image (WP-Optimize) that try to load media with the old path so have an error (Could not find file for image: blog_id=1, ID=817, file=C:\laragon\www\xxxxxxxwp-content/). i already use
    Better Search Replace plugin but it look like it do not work.

    Plugin Support vupdraft

    (@vupdraft)

    Just to clarify you are still using the same “Uploads” directory for your media?

    Can you add the following to your wp-config.php

    define(‘WP_HOME’,’http://yourwebsite.com/’); define(‘WP_SITEURL’,’http://yourwebsite/’);

    Thread Starter ludomania007

    (@ludomania007)

    yes i use the same “Uploads” directory for your media. My wp-config.php already had those lines and i can manage medias without any issue, it is only with your plugin. How do your plugin retrieve the absolute path?

    Plugin Support vupdraft

    (@vupdraft)

    I am just tagging in one of developers to assist.

    Thread Starter ludomania007

    (@ludomania007)

    @vupdraft thanks, hope we could have a feedback soon

    Plugin Contributor Venkat Raj

    (@webulous)

    @ludomania007 Which plugin did you used to move the site? If you have used UpdraftPlus, it will take care of both URLs and PATHs

    Do you have backup of the site in the old server?

    WP Optimize only uses path that are present in the database entries. It will not construct paths or modify it. When you upload a image, it is path will be stored in database by WordPress core itself. WP Optimize’s image compression only uses those entries.

    You are saying that it is only WP Optimize has errors. How can WPO aware of path like C:\laragon\www\xxxxxxxwp-content/ if it is not in database?

    Thread Starter ludomania007

    (@ludomania007)

    ok @webulous please which tables should I look to see those entries ?

    Plugin Contributor Venkat Raj

    (@webulous)

    @ludomania007 Most _posts and _postmeta However the entries can be in any table. For example, WooCommerce category image is in termsmeta and a users profile picture can be in usermeta etc

    So, if you have a backup, I would recommenced doing a proper migration.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Files path wrong after moving website’ is closed to new replies.