how to move wordpress directory: Problems with upload_path wp-content/uploads

Recently I was forced to move a wordpress site to a different webserver. By moving to a new server due to different hosting policies I also had to change the physical directory in which the wordpress files were stored. Before it was something like /var/www/wordpress afterwards it became /home/domainname/www/ . So after moving the data base and moving the wordpress installation and changing the DNS entry for the domain and some minor downtime in the middle of the night I figured out that some plugins on the new server would not work.
Especially those that needed to access uploaded files did have problems.

What happened?

After some debugging I did a fulltext search on the database for %/var/www/wordpress/ and i found one entry in wp_options table having: option_name =”upload_path” option_value=”/var/www/wordpress/wp-content/uploads” so obviously on installation time wordpress is saving the path of the upload folder in its option table to the data base. Still not sure weather this is a bug or a feature but I don’t have time to further investigate. Anyone some ideas?

You may also like...

Popular Posts

4 Comments

  1. It appears that `upload_path` is a legacy option. It was not set by default somewhere during the 3.0 releases. However, if it exists, it will still be used. My suggestion would be to remove it as doing so allows greater flexibility between environments. Proved by your specific issue.

  2. Thanks for sharing ! The fulltext search in wp_options is often the fastest way 🙂

  3. Thanks for sharing ! The fulltext search in wp_options is often the fastest way 🙂

  4. Thanks for sharing ! The fulltext search in wp_options is often the fastest way 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *