Make WordPress Core

Opened 7 years ago

Closed 7 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:


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)

#1 @markjaquith
7 years ago

  • Milestone changed from 2.7 to 2.8

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.

#2 @DD32
7 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/

#3 @jacobsantos
7 years ago

  • Keywords needs-patch added

#4 @mtekk
7 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.

#5 follow-up: @mtekk
7 years ago

Ok, after some more testing, it works correctly in [10258]. Looks like #8705 was a duplicate of part of the problem described here, and it was fixed in [10254].

#6 @hakre
7 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!

#7 in reply to: ↑ 5 @Denis-de-Bernardy
7 years ago

  • Milestone 2.8 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Replying to mtekk:

Ok, after some more testing, it works correctly in [10258]. Looks like #8705 was a duplicate of part of the problem described here, and it was fixed in [10254].

so closing as dup

Note: See TracTickets for help on using tickets.