Linux : Export Roundcube webmail contact from SQL to CSV

By | April 14, 2019

Here is a procedure how to export the saved address book contacts from Roundcube webmail directly from the MySQL database to a CSV file (please note that Roundcube natively support exporting contacts from the Webmail itself to CSV – this method is only in case you want to pull out old contacts from a database).

1. Using the shell, access to the Roundcube database with the MySQL client :

2. Issue the select command below with the exact syntax, only modify the section ‘user@domain.tld’ with the actual user email address from where you want to export the contacts from :

Output example :

3. Optional : To view the existing contacts in this user address book, issue the following command :

Output example :

4. Quit the MySQL client :

5. Create the CSV file scheme using the following command :

6. Issue this command to export the contacts to our previously defined CSV file (replace as needed the name of the CSV file output) :