WordPress.org

Ready to get started?Download WordPress

Forums

strange attachment path after moving to an other server (2 posts)

  1. teleport
    Member
    Posted 5 years ago #

    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:

    http://mindland.info/wp-content//var/www/mindland.info/wp-content/img_5231-150x150.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.

  2. teleport
    Member
    Posted 5 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic