Skip to content

Import, Export & Profiles

ContactTransferService and TransferProfileRegistry handle multi-platform address book exchange without manual column mapping. Platform groups, labels, and categories (Group Membership, Categories, Tag) map bidirectionally to canonical Contacts Tags (contacts-tags).

Profile ID Target Platform Supported Formats Notes
contacts ProcessWire Contacts native csv, json, vcf Full field fidelity, supports both Contacts and Organizations (csv/json).
google Google Contacts csv Maps Google Contacts CSV columns and Group Membership labels to Tags.
microsoft Microsoft Outlook / 365 csv Maps Outlook CSV columns and Categories to Tags.
apple Apple Contacts (macOS / iOS) vcf (vCard 4.0) Maps vCard 4.0 FN, N, ORG, TITLE, EMAIL, TEL, ADR, and CATEGORIES to Tags.
zoho Zoho CRM csv Maps Zoho CRM contact/account CSV columns and Tag values.
Terminal window
# Export VIP contacts as Google Contacts CSV or Apple vCard 4.0
php vendor/bin/wire contacts:export --type=contacts --format=csv --profile=google --tag=vip --output-file=vip-google.csv --json
php vendor/bin/wire contacts:export --type=contacts --format=vcf --profile=apple --tag=vip --output-file=vip-apple.vcf --json
# Auto-detect format and profile on import (dry-run first)
php vendor/bin/wire contacts:import site/modules/Contacts/examples/real-world/contacts-import.csv --profile=auto --dry-run --json
php vendor/bin/wire contacts:import site/modules/Contacts/examples/real-world/contacts-import.vcf --format=vcf --profile=apple --json
  • Flat CSV / vCard / Flat Row JSON: Defaults to --mode=upsert (matches existing contacts via ContactDeduplicator and merges missing fields without duplicating). Pass --mode=skip to ignore matching records.
  • Archive JSON ({"items": [...]}): Intentionally defaults to --mode=skip to prevent accidental UUID overwrites when restoring backups. Archive imports also reject multi-table 'tables' payloads and accept only items matching the target blueprint type.
<?php
declare(strict_types=1);
namespace ProcessWire;
$contacts = Contacts::requireInstance($this);
$transfer = $contacts->transfer();
// Export vCard 4.0 for a single contact or filtered batch
$singleVcard = $transfer->exportVcard($contact, ['profile' => 'apple']);
$csv = $transfer->exportCsv('contacts-contacts', ['profile' => 'google', 'tag' => 'vip']);
// Dry-run import a CSV payload
$preview = $transfer->importCsv('contacts-contacts', $csvContent, [
'profile' => 'auto',
'mode' => 'upsert',
'dryRun' => true,
]);

To add a custom ERP or CRM format, implement Totoglu\Contacts\Transfer\TransferProfileInterface (id, label, supportedFormats, defaultFormat, supportsBlueprint, detectScore, decode, encode) and register it via $contacts->registerTransferProfile($customProfile).

Next steps