Why can't the plugin overwrite a file? What are the necessary permissions?
The Unix systems (this includes Linux in all its flavors and distributions) have permissions and ownership for each file (read more here).
We have often seen that when a website is moved from one hosting provider to another, the permissions are correct but the ownership of a file is not correctly kept, or vice versa. For example, a file will have the correct write permissions but the file owner will be guest
instead of www-data
. This means that if you use a plugin such us Enable Media Replace or ShortPixel Image Optimizer, your attempt to replace a file will fail.
The solution to this problem is usually to contact your hosting provider after moving a website from one host to another and make sure that all your files have both the correct ownership and permissions. Once this is fixed you'll be able to replace files using plugins like the ones mentioned above.