Using Drupal 7.12 I'm building a live site and wish to duplicate the database. I used phpmyadmin to copy the database on the server and cpanel to download to my pc.
I keep running into an error: ERROR 1062 (23000) at line 27: Duplicate entry 'comment_publish_action' for key 'PRIMARY'
I have tried mysql -uname -pword database < copied_data.sql copied the structure, have copied the structure only then tried to insert the data but get the same error. I tried deleting the offending INSERT INTO table but the error simply transfers to the next INSERT. Haven't run into this before! Where should I look for help please. Thanks Roger
I am not sure about the solution to the issues but try using this module http://drupal.org/project/backup_migrate to migrate and see if it works,
On 05/04/2012, Roger arelem@bigpond.com wrote:
Using Drupal 7.12 I'm building a live site and wish to duplicate the database. I used phpmyadmin to copy the database on the server and cpanel to download to my pc.
I keep running into an error: ERROR 1062 (23000) at line 27: Duplicate entry 'comment_publish_action' for key 'PRIMARY'
I have tried mysql -uname -pword database < copied_data.sql copied the structure, have copied the structure only then tried to insert the data but get the same error. I tried deleting the offending INSERT INTO table but the error simply transfers to the next INSERT. Haven't run into this before! Where should I look for help please. Thanks Roger -- [ Drupal support list | http://lists.drupal.org/ ]
On Thu, Apr 5, 2012 at 4:59 AM, Roger arelem@bigpond.com wrote:
Using Drupal 7.12 I'm building a live site and wish to duplicate the database. I used phpmyadmin to copy the database on the server and cpanel to download to my pc.
IMO, phpmyadmin is the wrong thing to use for Drupal DB due to size. I tend to use mysqldump -uname -pword database > mysite.sqldump.
I keep running into an error: ERROR 1062 (23000) at line 27: Duplicate entry 'comment_publish_action' for key 'PRIMARY'
Makes you wonder how the data was entered into the DB doesn't it? :D Was there a primary key on the original DB table? You could try dropping the PRIMARY key declaration in the dumped file (i.e. mysite.sqldump) before you import it and then try adding a PRIMARY key after the data is imported.