Monday, May 9, 2011

Moving to another Server: Duplicate entry ‘1’ for key 1

Method 1:
SET FOREIGN_KEY_CHECKS = 0;
UPDATE `core_website` SET `website_id` = 0 WHERE `core_website`.`code` = 'admin'  LIMIT 1 ;
UPDATE `core_store` SET `store_id` = 0 WHERE `core_store`.`code` = 'admin' LIMIT 1 ;
SET FOREIGN_KEY_CHECKS = 1; 

Method 2:
* Go to table `core_website` through phpmyadmin and set `website_id` = 0 for admin.
* Go to `core_store` and SET `store_id` = 0 for admin.

No comments:

Post a Comment