• Resolved Chris Whiteley

    (@thewhite)


    I have redesigned a site for a client, and to start the project the development site was an exact duplicate of live site. The pages on the development site have been changed during the redesign, but the posts have remained the same. On the live site, the posts have continued to be published during development, as well comments have been being posted as well.

    The posts on the development site need to match the current live site, before I launch my redesign. When it goes live all the posts and comments need to be up to date and match. I originally thought I could just import the wp_comments and the wp_posts and be good to go, but only now realized that the pages are lumped into the wp_posts as well. So now I have to copy over wp_comments and only the rows in the wp_posts that have ‘post’ post_type.

    With all this in mind I have two questions:

    1. To move all the comments over can I just upload the live wp_comments to the development database and have it overwrite or are there other considerations that need to be made.

    2. Is there a way to upload just the posts with the “post_type” from wp_comments. If so is there a specific resource that you can share that explains step by step how to do this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1. I don’t think it’s going to be that simple. Each comment has a ‘comment_post_id’ which associates it to the correct post or page. These have to match for the comment to appear. Then you also have a ‘comment_parent’ and a ‘user_id’ field which needs to match.

    2. You can run a SQL query from within PhpMyAdmin that will export all the rows with your custom criteria.

    But… it’s the joining of these together at the end that is a concern of mine.

    Thread Starter Chris Whiteley

    (@thewhite)

    If I added the new posts first, and then added in the comments would that overcome any ID issue? I’m presuming that if I import the new posts through PhpMyAdmin that they would have the same ID?

    Is that accurate?

    Thread Starter Chris Whiteley

    (@thewhite)

    It appears that I tried to over think and over complicate a very simple issue. The WordPress exporter allows the posts to be exported from specific date ranges. The post export also includes comments.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Partial Database Upload of Posts and Comments’ is closed to new replies.