We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Port database to EE - [Err] 1062 - Duplicate entry '0' for key 'PRIMARY'

Development and Programming

w84me's avatar
w84me
95 posts
14 years ago
w84me's avatar w84me

Hi all,

I need to port a database from a old site with a schema different of EE has. I have a table homes and I want to insert each entry as a channel entry. I am trying to do run a query like this:

INSERT INTO exp_channel_data (site_id,channel_id,field_id_1) SELECT 1,1,summary FROM homes

But I get the following error:

[Err] 1062 - Duplicate entry ‘0’ for key ‘PRIMARY’

It has to be the exp_channel_data.entry_id that is not auto_increment but is it safe to edit it?

Thanks in advance

       
w84me's avatar
w84me
95 posts
14 years ago
w84me's avatar w84me

Hmm maybe I’ll try to add a ON DUBLICATE KEY check

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.