I can not upload images to my WordPress site after moving it

When moving a site to a different server, or even when moving it to a different directory on the same server, it is common to experience upload related problems. If you used to be able to upload images via the WordPress backend and after moving your site you start getting errors like the one below, this article might help get this fixed.

"some-image.png" has failed to upload due to an error
Unable to create directory uploads/yyyy/mm. Is its parent directory writable by the server?

The problem is that WordPress stores an upload_path option in the database, namely in the wp_options table. This upload_path contains the “absolute path” to where WordPress should store uploaded files. If your site’s location in the server’s file system has changed, which will likely have happened if you moved your site, you will need to update this option directly in your database to reflect the new absolute path to the uploads folder. This can be done using the phpMyAdmin interface available from the ENOISE hosting control panel.

For example, lets say that I have an ENOISE shared hosting package for mydomain.com and I have a site in a subdirectory at http://mydomain.com/test-site/. Then I decide to move this site to http://mydomain.com/blog/. To do this I would simply rename the test-site folder to blog. This change will have broken your uploads, so in order to fix this I’d need to:

  1. Go to my hosting control panel. (Not sure how to? How do I access my hosting control panel?)
  2. Browse my MySQL databases
  3. Open the relevant database using phpMyAdmin
  4. Find the wp_options table and the upload_path option in particular
  5. Change the value of upload_path from /home/sites/mydomain.com/public_html/test-site/wp-content/uploads to /home/sites/mydomain.com/public_html/blog/wp-content/uploads