• Hi there!

    I have a strange problem with my WordPress installation. I want to move to another domain. I dumped the database and replaced the old domain name with the new one as required. On the new site most of the image paths are dead. They look like this:

    https://mindland.info/wp-content//var/www/mindland.info/wp-content/img_5231-150×150.jpg

    There are parts of the file system path in it. So I erased the part

    /var/www/mindland.info/wp-content/

    The images are linked, BUT to the full size versions, not the thumbnails. ??

    So I dumped the database again and tried to setup a local installation with the original database. I edited the hosts file to link my (old) domain name to my local webserver. Same effect as above.

    Whats going on here? Am I suffering from a very rare bug? ??

    Thanks as well.

Viewing 1 replies (of 1 total)
  • Thread Starter teleport

    (@teleport)

    Ok, I tried it on my own, and I have found a solution: In the database, there is a table named wp_postmeta. Entrys with the meta_key ‘wp_attached_file’ containing the filename of an attachment in the field ‘meta_value’

    The older wordpress installations linked the whole filesystem based path to the image. The new one, v2.7(.1) has filled the field out with the filename only.

    With the mysql command

    update wp_postmeta set meta_value = replace(meta_value, ‘/var/www/mindland.info/wp-content/’, ”) where meta_key=’_wp_attached_file’

    and

    update wp_postmeta set meta_value = replace(meta_value, ‘/var/www/vhosts/mindland.info/httpdocs/wp-content/’, ”) where meta_key=’_wp_attached_file’

    I earsed the full file system paths.

    My current question is: Why the image links are correct and working on my old domain?

Viewing 1 replies (of 1 total)
  • The topic ‘strange attachment path after moving to an other server’ is closed to new replies.