There are other ways too, byt iterating through the contacts database and getting all the ids and then exporting it.
But In any case you will not be able to eport or import templates and groups with data in it. I mean after exporting and importing, i must have the contacts database with all the groups with members and all the templates i have created.
When i export a template id list, i am not getting the tamplate names similar issue is there with groups too. (you can debug and see the data in the buffer).
Can any one answer the issue of why we are not able to import and export templates and groups?