1 of 1 users consider this post helpful
Re: Contacts Admin App - download all contacts
Hello Johnny,
Can you try to replace the last line of the wiki-article
https://wiki.innovaphone.com/index.php?title=Reference13r3:Concept_App_Service_Contacts#Manually_Exporting_all_Contacts ?
Original (complete entries-table) mentioned in the article:
psql -d "innovaphone.com_contacts" -c "copy entries to '/mnt/sda2/home/admin/export/contacts.csv' delimiter ';' CSV HEADER"
Adjusted line (complete entries-table + left joins to numbers and email-tables):
psql -d "innovaphone.com_contacts" -c "copy (
SELECT ent.*,
num1.number AS number,
num2.number AS work,
num3.number AS mobile,
num4.number AS homephone,
num5.number AS fax,
em.email AS email
FROM entries AS ent
LEFT JOIN numbers num1 ON ent.id = num1.entryid AND num1.numbertype = 1
LEFT JOIN numbers num2 ON ent.id = num2.entryid AND num2.numbertype = 2
LEFT JOIN numbers num3 ON ent.id = num3.entryid AND num3.numbertype = 3
LEFT JOIN numbers num4 ON ent.id = num4.entryid AND num4.numbertype = 4
LEFT JOIN numbers num5 ON ent.id = num5.entryid AND num5.numbertype = 5
LEFT JOIN emails em ON ent.id = em.entryid
) to '/mnt/sda2/home/admin/export/contacts.csv' delimiter ';' CSV HEADER";
Change in the above statement the database-name 'innovaphone.com_contacts' and the filename 'contacts.csv'.
Kind Regards,
Elias