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).
Built-In Transfer Profiles
Section titled “Built-In Transfer Profiles”| 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. |
CLI Import & Export Recipes
Section titled “CLI Import & Export Recipes”# Export VIP contacts as Google Contacts CSV or Apple vCard 4.0php vendor/bin/wire contacts:export --type=contacts --format=csv --profile=google --tag=vip --output-file=vip-google.csv --jsonphp 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 --jsonphp vendor/bin/wire contacts:import site/modules/Contacts/examples/real-world/contacts-import.vcf --format=vcf --profile=apple --jsonConflict Strategies (upsert vs. skip)
Section titled “Conflict Strategies (upsert vs. skip)”- Flat CSV / vCard / Flat Row JSON: Defaults to
--mode=upsert(matches existing contacts viaContactDeduplicatorand merges missing fields without duplicating). Pass--mode=skipto ignore matching records. - Archive JSON (
{"items": [...]}): Intentionally defaults to--mode=skipto prevent accidental UUID overwrites when restoring backups. Archive imports also reject multi-table'tables'payloads and accept only items matching the target blueprint type.
Programmatic Transfer & Custom Profiles
Section titled “Programmatic Transfer & Custom Profiles”<?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).