[wp-trac] [WordPress Trac] #41947: upload_path wrong after server move
WordPress Trac
noreply at wordpress.org
Thu Sep 21 23:47:28 UTC 2017
#41947: upload_path wrong after server move
--------------------------+-----------------------------
Reporter: steevithak | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.8.2
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I recently moved a Wordpress 4.8.2 site from one server to another. The
Domain name did not change. I moved the site by copying the files to the
new server. The database did not move, it remained on the same, remote
server.
After the move the site exhibited problems related to the upload directory
path and was spuriously creating empty upload directories in the wrong
place. If the spurious upload directories were deleted, they reappeared
again within minutes.
On the original server, websites were in a directory path like this:
/var/www/whatever.com/www
On the new server, website paths were only slightly different, like so:
/var/www/whatever.com/html
I eventually discovered (by checking the wp-admin/options.php page) that
the upload_path was still pointing to the path used on the old server
(i.e. "/var/www/whatever.com/www/wp-content/uploads"). This incorrect
value was apparently leading Wordpress to try to recreate the upload
directory and subdirectories along the old, now non-existant path.
After manually changing the upload_path value to match the correct
location on the new server, everything started working ok again. None of
the server migration guides provided in the wordpress docs warn about this
problem or mention the symptoms or how to detect that a change is needed,
or tell you how to reach the options.php page where the problem can be
diagnosed and fixed. For example, here's the best documentation I could
find on moving a wordpress site:
https://codex.wordpress.org/Moving_WordPress
So it seems there are two possible bugs here and I'm not sure which is
valid and needs to be fixed.
Possibility 1: Wordpress core should adjust the upload path automatically
when the site is moved and failure to do so is a bug.
Possibility 2: There's some valid reason why Wordpress can't detect the
change or update the upload_path value automatically and this not a code
bug but an unfortunately pitfall of moving Wordpress sites. In this case,
I think we're just dealing with a Wordpress documentation bug in that the
migration document fails to warn about this problem or describe the fix
for it.
One simple fix might be to make the upload_path visible in the admin
general settings page where the other paths are found as this is the first
place I looked when I began to suspect the problem. It took a little
googling to find out there were more settings that are only accessible on
the hidden options.php page.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41947>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list