Hi Paul,
The squirrelmail setting weren't stored in a database, but on file in the 'data' directory. I fetched all the settings with a small script, directing the output to a file.
#!/bin/bash
for FILE in *.abook ; do
EMAIL=`basename "$FILE" .abook`
cat "$FILE" | awk '{print "'$EMAIL'|"$0}'
done
Than I imported that file as CVS (with '|' as separator) in a new table and ran 2 queries, to import the users and the contacts.
CREATE TABLE `contacts_import` (
`user_email` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`firstname` varchar(255) default NULL,
`lastname` varchar(255) default NULL,
`email` varchar(255) NOT NULL,
`remarks` text,
KEY `user_email` (`user_email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO users SELECT NULL, user_email, "10.0.0.100", NULL, NOW(), 0, 'en', NULL FROM contacts_import LEFT JOIN users ON contacts_import.user_email = users.username WHERE users.user_id IS NULL
INSERT INTO contacts SELECT NULL, NOW(), 0, contacts_import.name, contacts_import.email, contacts_import.firstname, contacts_import.lastname, NULL, users.user_id, remarks FROM `contacts_import` INNER JOIN users ON contacts_import.user_email = users.username LEFT JOIN contacts ON users.user_id = contacts.user_id AND contacts_import.email = contacts.email WHERE contacts.contact_id IS NULL
I hope this helps, even if you have the data in a DB instead of in files.
Best regards,
Arnold