Opened 15 years ago
Closed 15 years ago
#8534 closed defect (bug) (duplicate)
Uploads impossible to migrate during domain name change or host change
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | critical | Version: | 2.7 |
Component: | Upload | Keywords: | media needs-patch |
Focuses: | Cc: |
Description
Media files are stored using the absolute path to the file.
When changing the root folder, changing domain name, or changing a web host, it seems almost impossible to move uploads without having to totally re-upload them and attach them.
Using the import/export tool does not alleviate this problem.
Any popular articles available online about this subject (located at wordpress.org or others) fail to mention this completely.
Also, changing the uploads directory location in admin settings does not retro actively move files or change the database entries to reflect this change, resulting in the need for multiple upload folders.
In my opinion, this is a major oversight. I understand that 2.8 will introduce better upload/media management, and I hope that this issue is addressed along with that update.
Change History (7)
#2
@
15 years ago
Also, there are some plugins which can search through your posts and replace the image URL's(and inter-blog links) with the new ones, Eg: Search and Replace = Search for your old path (ie. http://old-host.com/wordpress/), replace with new path (http://new-host.com.au/blog/), Its useful for replacing absolute links in your posts/pages/
#4
@
15 years ago
I'm seeing this behavior for uploads made in a fresh 2.7 install, so [8796] did not fix it, or there has been a regression.
#6
@
15 years ago
Just today another user reported this problem in the support forums. Those kids are moving from one domain to the other while chaning the server. Afterwards, they can not get their wordpress any longer to run.
Drupal has a very nice feature that it automatically recorgnizes which domain name to use automatically. It works pretty well!
For about three months, 2.7 has stored media files using a relative path. See changeset [8796].
Do note that it only applies to new uploads. Uploads made using an earlier version of WordPress will still have a full path. We can probably fix this for 2.8 with a one-time upgrade routine. We can also address the issue of whether WordPress should relocate your files when you change the upload directory. That might not scale very well. At the very least, we should tell people that they'll have to move the files themselves when we detect the change.