最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

uploads - Import images from old WordPress site into new site

programmeradmin1浏览0评论

I have exported both tables from old wordpress site of which gallery images i want to import into new wordpress site.

After export, i follow following steps:

--> In the wp_posts.sql file I did the following:

  1. First I change all the INSERT INTO sentences to INSERT IGNORE INTO in case duplicate keys exists It don’t break them

  2. I modified all image urls to match new domain (not always needed, depending where you are importing from)

  3. I removed all unnecessary SQL code such as ALTER TABLE and INSERT TABLE and just left the INSERT INTO SENTENCES Ziped the file and imported into new site db with phpmyadmin

    --> In the wp_postmeta.sql file I did the following:

    1. I removed all the unnecessary SQL code such as ALTER TABLE and INSERT TABLE and just left the INSERT INTO SENTENCES
    2. I changed all the INSERT INTO wp_postmeta ( meta_id, post_id, meta_key, meta_value) VALUES to INSERT INTO wp_postmeta ( post_id, meta_key, meta_value) VALUES . Basically Im removing meta_id because I want to insert all the postmeta at the end of the table and use the auto increment
    3. I did a regex search and replace to remove all ID from values. I used ( ([0-9]+), and replaced with just ( Zipped file and imported to new site

-->The last step is to copy the image files into the wp-content/uploads/

-->Before import these tables into new wordpress database, i removed Create Table code from both files to avoid exiting table error. --> Both tables successfully imported, but in media folder images have not reflected. It is only showing demo images of theme installed and activated.

Kindly provide solution in this case.

Thanks

发布评论

评论列表(0)

  1. 暂无评论