After I back-up Mac Contacts to a .abbu file, is there a program that lets me get at the underlying data vs. just importing them? I.e., can I open them as a text file or .CSV. Thank you!
I had my contacts backed up in an
abbu file exported from Yosemite Contacts. When I tried to import them into El Capitan Contacts, I encountered the same problem as fish923.
This sucked because the
abbu file was my only backup.
I looked into it and an
abbu file (actually a folder) appears to be basically a copy of the internal data used by Contacts. With no way to import it, there is no way to export it into a saner format, like a bunch of vCards.
Try to avoid ever getting into this situation. If it's too late, here is what you can do:
- Download a SQLite client like Base, MesaSQLite, SQLite Manager, etc. (Alternatively you could try the command line: https://stackoverflow.com/questions/5776660/export-from-sqlite-to-csv-using-shell-script)
- Right-click on your
abbufile and Show Package Contents. Navigate into the Sources folder. One of these UUID subfolders corresponds to one of your CardDAV accounts. Pick one.
- Open up the
AddressBook-v22.abcddbfile in your SQLite client.
- Enter the following SQL query. Note that this is just something quick & dirty that I came up with in an exasperated state, and does not preserve everything, so feel free to modify it by examining the individual tables to see whether there is any data you want that it leaves out:
SELECT ZABCDRECORD.Z_PK, ZABCDRECORD.ZBIRTHDAYYEAR, ZABCDRECORD.ZFIRSTNAME, ZABCDRECORD.ZMIDDLENAME, ZABCDRECORD.ZLASTNAME, ZABCDRECORD.ZORGANIZATION, ZABCDRECORD.ZJOBTITLE, ZABCDPHONENUMBER.ZFULLNUMBER, ZABCDPHONENUMBER.ZLABEL, ZABCDPOSTALADDRESS.ZCITY, ZABCDPOSTALADDRESS.ZCOUNTRYNAME, ZABCDPOSTALADDRESS.ZLABEL, ZABCDPOSTALADDRESS.ZSTATE, ZABCDPOSTALADDRESS.ZSTATE, ZABCDPOSTALADDRESS.ZZIPCODE, ZABCDEMAILADDRESS.ZADDRESS
LEFT JOIN ZABCDPOSTALADDRESS ON ZABCDPOSTALADDRESS.ZOWNER = ZABCDRECORD.Z_PK
LEFT JOIN ZABCDEMAILADDRESS ON ZABCDEMAILADDRESS.ZOWNER = ZABCDRECORD.Z_PK
LEFT JOIN ZABCDPHONENUMBER ON ZABCDPHONENUMBER.ZOWNER = ZABCDRECORD.Z_PK;
Behold, most of your contacts data. Export this into CSV or whatever, and have fun manually re-entering it into Contacts. Or, I guess you could write a script to process the CSV into vCards, if Contacts doesn't choke on those too.
In Contacts Version 8.0 (1371) running on OS X 10.9.4, you can export a multi-card file in the .vcf format as follows:
- Launch the Contacts application.
- Ensure that all your contacts are showing by clicking "All Contacts" in the Groups panel. (If you don't see the Groups panel, which starts with "All Contacts," on the left side of the window, choose View > Show Groups from the menu.)
- Click the first contact on the contacts list.
- Choose Edit > Select All from the menu. Ensure that the card detail area on the right shows how many cards have been selected (e.g., "612 Cards Selected").
- Choose File > Export > Export vCard...
- Enter the desired export filename and location, and click Save.
You will now have a single .vcf file with all of your contacts. This is a text file which you can open with TextEdit. You may also find tools that convert .vcf to other formats, such as .csv, if you need it.
This .vcf file can be used to restore your contacts or migrate them to other devices.
If you have iWorks/Numbers installed, check the tutorial:
ABBU is the native file type for the Mac OS X Address Book, which means that you can only open ABBU files using the Mac Address Book application. However, you can use the iWork Numbers application to import the ABBU file, and then export the data file to a Comma Separated Value, or CSV, file format, which is a generic text file format that you can import into any address book or database application, regardless of operating system.
Also you could try the tool:
Also known as Address Book to CSV Exporter, this Mac OS X utility allows the user to export his own Address Book in a CSV or VCF file.
You did mention "vs just importing them", but if you can use the first method to export them to Numbers, you can then save as
I FOUND A SOLUTION to some of the problems laid out here.
I had the exact same problem as fish923, I had a .abbu file and every time I tried to import my contacts the Contacts app synced with iCloud and erased all contacts.
To restore your backup successfully you need to do this:
1.- Disconnect from the internet.
2.- go to your user AddressBook folder inside your Library folder: Users/(your user)/Library/Application Support/AddressBook/…
3.- Delete contents inside AddressBook folder (or move them to the Desktop just in case)
4.- Right click on your .abbu file and select “Show Package Contents”.
5.- Copy contents from your .abbu file to the AddressBook Folder.
6.- Open Contacts app and export all contacts as vCard (make sure you select all contacts for export).
7.- Now you can connect to the internet, the Contacts app will sync with iCloud and again remove all your contacts but don't worry, you can now import the form de vCard file.
This worked for me. Hope it helps somebody.
There is a way to access directly to the data saved within a
.abbu (Address Book Backup) directory.
Let's say you saved your address book as proposed by default with the name
Contacts - DD-MM-YYYY.abbu.
You will have to use the command line for this with:
cd 'Contacts - DD-MM-YYYY.abbu/Metadata' plutil -convert xml1 *
If you want to work directly on these plist files,
and later use them within your addess book,
I advise to first test this on a test account, let's say
Bob test account, you will have to bring the
.abbu in place
/usr/bin/sudo cp -r 'Contacts - DD-MM-YYYY.abbu/' '/Users/bob/Library/Application Support/AddressBook' # the / after .abbu directory name is mandatory to copy the contents # in the destination directory, this will overwrite the address book # of Bob /usr/bin/sudo rm '/Users/Bob/Library/Application Support/AdressBook/AddressBook-v22.abcddb' # the removal of this `.db` will force `Contacts` to rebuild it from # the contents of the `Metadata` directory. /usr/bin/sudo chown -R bob '/Users/bob/Library/Application Support/AddressBook'
Warning: don't copy and paste the above commands if you don't fully understand what they do. A space or a star anywhere might damage your working account, your working MacOS X.
Bob to check this new address book.