Solution to cannot edit or delete some On My Mac contacts
There are various symptoms of a corrupted "On My Mac" Contacts list. I have seen these:
- Contacts cannot be edited: they temporarily disappear from the list.
- Contacts cannot be deleted: they temporarily disappear from the list.
- Contacts cannot be exported as a vCard (VCF) file: a zero byte file Contact.vcf is created.
- Mail does not recognise some addresses present in Contacts.
So far as I can tell, this all started after migrating from Mojave to Monterey, but I am not completely sure. My wife's contacts in her account on the same Mac are also affected.
The suggestion I found in several place to delete the files ~/Library/Application Support/AddressBook/AddressBook-v22.abcddb, *-shm and *-wal does not always work. Contacts may not rebuild the data from the files in sub-folder Metadata. Deleting a file in Metadata also does not work: Contacts recreates the file, the corruption remains.
Some people report that synchronising via iCloud helps. This solution does not require iCloud.
The solution is manually to export all the cards as VCF files, delete the database and import the files to build a new database. It depends on the strange behaviour that a corrupt contact can be copied and pasted inside Contacts to create an exportable almost-duplicate copy (without the picture).
Before you start make a backup in Contacts with menu File > Export > Contacts Archive.
This is simply a package of all the files. The corruption is preserved.
- Create a folder for the VCF files.
- For each contact you want to keep, click on it and drag it to a folder.
- Check that the folder contains a new VCF file with the name of the contact.
- If a new file named Contacts.vcf is created instead, do this:
- In Contacts select the contact.
- Press Cmd+C Cmd+V to copy/paste. (This creates a usable contact without a picture.)
- Drag the selected contact. Check as above.
- In Contacts press Cmd+Z to undo the paste.
- Delete the redundant Contact.vcf file.
- Continue from 2. above until all contacts are exported.
- Sort the folder in date order and check that you have exported all required contacts.
- View as gallery to check that all the files have readable content.
- Record group membership, e.g. as screen pictures.
- Close Contacts.
- Delete all files in folder ~/Library/Application Support/AddressBook.
- Open Contacts. It will be empty. It creates new files in ~/Library/Application Support/AddressBook.
- Select all the VCF files and drag them into the Contacts window. Confirm.
- Select your own name. Press Cmd+C Cmd+V. Select menu Card > Make This My Card. (You lose the picture. You cannot make the original My Card for some reason.)
- Delete the original version of your contacts entry.
You could drag groups of contacts to create a multi-contact VCF file. This makes it more difficult to identify and deal with problems as you have to open the VCF file in TextEdit to inspect it.
Apple, please fix this software.
MacBook Pro 14″, macOS 12.6