Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

migrating comments between wordpress installations

I've been working on migrating comments from an old WP install to a new one. The tricky part is that the on new install, the post ID's are different. I've written a script to match up the correct post ID's, but how do I insert them?

I need to give them unique commend_ID's. Is there a function in mysql to insert the highest unique number? Or should I just find the highest value via PHP and increment upon each insertion?

Will I need to do anything to generate commentmeta?
0
SonicVoom
Asked:
SonicVoom
1 Solution
 
gwkgCommented:
You probably want to use a native WordPress function for this

wp_insert_comment()

http://codex.wordpress.org/Function_Reference/wp_insert_comment

or wp_new_comment()

You can see what those functions do in comment.php:  http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/comment.php
0
 
SonicVoomAuthor Commented:
yep, wp_insert_comment() did the trick.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now