I want to globally replace all instances of the URL of my site in the Wordpress MySQL database with the new site URL. To do this, I use phpMyAdmin to export the database to a .sql file, and then do a global replacement in a text editor, and then use phpMyAdmin to import the .sql file.
During import, I encounter a duplicate entry for a primary key error. Trying to debug this, I exported the file, then imported the identical file without making any changes, and I still get the same error.
I appreciate any help in resolving this issue.
INSERT INTO `wp_comments`
(`comment_ID`, `comment_post_ID`, `comment_author`, `comment_author_email`
,`comment_author_url`, `comment_author_IP`, `comment_date`, `comment_date_gmt`
,`comment_content`, `comment_karma`, `comment_approved`, `comment_agent`
,`comment_type`, `comment_parent`, `user_id`)
VALUES (1, 1, 'Mr WordPress', ''
,'http://wordpress.org/', '', '2011-04-28 00:49:55', '2011-04-28 00:49:55'
,'Hi, this is a comment.<br />To delete a comment,
just log in and view the post's comments.
There you will have the option to edit or delete them.'
, 0, 'post-trashed', '', '', 0, 0 ) ;
MySQL said: