admin管理员组文章数量:1302383
I am redeveloping a client's site and, for a number of reasons, in the process changing hosts. I'm developing it on the new host and to get the site orgainised I have attempted to import all the pages from the old site using the WordPress export/import plugins.
During the import I checked the "import images" checkbox but it doesn't seem to have worked. All the images in the pages are being loaded from the old site and the media library in the new site is empty. Here are the URLs for reference:
new site:
old site:
I am redeveloping a client's site and, for a number of reasons, in the process changing hosts. I'm developing it on the new host and to get the site orgainised I have attempted to import all the pages from the old site using the WordPress export/import plugins.
During the import I checked the "import images" checkbox but it doesn't seem to have worked. All the images in the pages are being loaded from the old site and the media library in the new site is empty. Here are the URLs for reference:
new site: http://sergedenim.es
old site: http://sergedenimes
Share Improve this question edited Nov 14, 2012 at 12:57 Chip Bennett 55.1k8 gold badges90 silver badges170 bronze badges asked Nov 14, 2012 at 9:24 harrygharryg 7635 gold badges11 silver badges23 bronze badges 1 |4 Answers
Reset to default 5Although Chip's method may work for some it did not for me. I did get it working however this way:
- Do the normal export of pages and posts and import them to your new blog (having deleted the original pages and posts)
- Download the wp-content/uploads folder via ftp from your old site and upload it to your new site, replacing what's there.
- Go into phpmyadmin on the old site and use an SQL query to select all posts that have post type = "attachment" in the wp_posts table. Export the results of this query and save on your PC.
- Export the wp_terms table from your old site.
- Import both the mySQL exports from your old site into your new site via phpmyadmin.
- Use the "search and replace" plugin to replace all occurrences of your old domain in your database with your new domain.
If all goes well you should have all your attachments in your new site along with all thumbnails stored and referenced correctly.
Did you tried to use plugin that updates urls after changing url of medialibrary?
Velvet Blues Update URLs
- Ensure both domains are active
- Ensure the same version of WordPress is installed on both domains
- Ensure the Same Theme is active on both domains
- Ensure the Same Plugins are active on both domains
- Ensure that the images are hosted and attached in the old domain.
- Delete all default/dummy post data from the new domain (Test Post, About page, etc.)
- Export all content from the old domain
- Import the resulting XML file to the new domain
- Ensure download and attach media is enabled/checked
- Note any errors printed during the import process
A client wanted to start a new wp with all their old wp´s images, here is how I did it:
- copy the uploads folder to the new directory
- On the old site make an sql dump only containing the attachments, eg:
mysqldump --opt --user="user" -p database_name wp_posts --where="post_type='attachment'" > exported_attachments.sql
Open the exported_attachments.sql in text-editor and replace all occurences of the old protocoll+domain to the new, eg. http://site-old -> https://site-new
Import the sql into the the new database
done :)
本文标签: media libraryImport Images from one selfhosted WordPress install to another
版权声明:本文标题:media library - Import Images from one self-hosted WordPress install to another 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741703490a2393427.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
error_log
shows? – brasofilo Commented Nov 14, 2012 at 11:30