Please don't top post.  Read the mailing list posting guidelines before posting.

>>>  I was hoping someone can help with converting the .abook flatfiles into
>>> mysql records. We were able to generate a sql script that should allow us
>>> to
>>> import all the .abooks by using the flat2sql.pl file that was supplied
>>> from
>>> http://www.squirrelmail.org/docs/admin/admin-5.html#db-backend, but as you
>>> can see below the INSERT command attempts to add multiple enteries in the
>>> same sqmail.address table. This of course generates a sql error.  The
>>> error
>>> references duplicate entry's for this one record.
>>>
>>> As you guess this user has more than one address in their .abook record.
>>
>> PRIMARY KEY (owner,nickname) is going to give you trouble if all your
>> nicknames are ''
>>
>> Maybe change it to PRIMARY KEY (owner,email) ?
>
> Actually the problem seems to be with multiple entries with the same owner
> name

Then show the contents of the original .abook file

>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Real Name','email.n...@company','');
>>
>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Real Name','email.n...@company','');
>>
>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Hoksbergen','edsyl...@iowatelecom.net','');
>>
>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Nancy King','njk...@marykay.com','');
>>
>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Krish & Bob
>> Fennessy','nana1...@comcast.com','');
>>
>> INSERT INTO sqmail.address (owner,nickname,firstname,lastname,email,label)
>> VALUES ('jcmerchant','','','Rita Glasscock','pl...@aol.com','');

------------------------------------------------------------------------------
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@lists.sourceforge.net
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): 
https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to