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

database - Importing New Posts from Live Site into Local Dev Site

programmeradmin6浏览0评论

I'm currently developing an updated version of a live site in a local environment. It's a very large site and the local dev site is using a entirely new theme without many of the live site's plugins or functionality. The live site uses Avada Fusion and almost all content is wrapped in shortcodes forcing me to basically re-publish each post manually using the dev site's new setup (using ACF Pro, custom fields). I've spent weeks removing the live site theme, unnecessary thumbnails, plugins, and all sorts of space hogging files. The only problem is bringing in the new posts from the live site. They are adding new posts weekly and I'm about 25 behind. :)

Is there a way to export/import the new posts from the live site into the local dev site that would include all the posts' featured images, galleries within the post, etc? This would only be for posts, and I would love to pull from a specific date like May 15 to Current.

I attempted the standard Tools > export/import and it added the posts ok but it didn't include featured images or any of the images within the posts. I'm curious about plugins like WP Migrate DB Pro and their merge feature but I don't want to overwrite or add back any of the images I've painstakingly removed or regenerated with lossless compression.

I'm currently developing an updated version of a live site in a local environment. It's a very large site and the local dev site is using a entirely new theme without many of the live site's plugins or functionality. The live site uses Avada Fusion and almost all content is wrapped in shortcodes forcing me to basically re-publish each post manually using the dev site's new setup (using ACF Pro, custom fields). I've spent weeks removing the live site theme, unnecessary thumbnails, plugins, and all sorts of space hogging files. The only problem is bringing in the new posts from the live site. They are adding new posts weekly and I'm about 25 behind. :)

Is there a way to export/import the new posts from the live site into the local dev site that would include all the posts' featured images, galleries within the post, etc? This would only be for posts, and I would love to pull from a specific date like May 15 to Current.

I attempted the standard Tools > export/import and it added the posts ok but it didn't include featured images or any of the images within the posts. I'm curious about plugins like WP Migrate DB Pro and their merge feature but I don't want to overwrite or add back any of the images I've painstakingly removed or regenerated with lossless compression.

Share Improve this question asked Jul 5, 2020 at 17:18 jdashleyjdashley 233 bronze badges 1
  • Strange, it should pull all the images from the live site when importing to localhost - check that the image URLs are present in the XML file: wordpress/support/topic/tools-export-media – montrealist Commented Jul 8, 2020 at 2:17
Add a comment  | 

2 Answers 2

Reset to default 0

Have you considered to use REST API to bridge the two environments?

Basically you need to hit the posts endpoint https://example/wp-json/wp/v2/posts using the after argument that permit to limit response to posts published after a given ISO8601 compliant date.

With the response you can insert new posts and sync the two installation.

More detail about the endpoint and the arguments can be found here https://developer.wordpress/rest-api/reference/posts/

Thank you for the responses. I was able to get it handled by using a plugin.

https://wordpress/plugins/export-media-with-selected-content/

I'm going to look into the REST API solution for keeping it up to date while I continue the development side of the project.

发布评论

评论列表(0)

  1. 暂无评论