9 Replies Latest reply: Oct 3, 2010 2:10 PM by Johann Beda
BioRich Level 1 (65 points)
Hi folks. Just wanted to know if anybody knew how to merge 2 address books. I don't mean two identical or similar contacts. Whole address books.

A duplicated, put into B machine. They both took on separate lives.

This is what I am thinking:

- A backed up.
- B exported.
- B imported into A, conflicts resolved (that could take some time, if it's manual, as my book has 1600 cards)
- A (which is new), exported, put back into B.

Any ideas?


G5 1.8, Blackbook 2.0, Mac Pro 2.8 (8c), iMac 17 2.0, Touch2, Shuffle2, iPod40, Mac OS X (10.6.4), iPhone? Heck I'm still giggly about MultiFinder!
  • A.Carlo Level 2 (270 points)
    What about your method did not work (what does "They both took on separate lives" mean)? I've done that before (took my address book from Windows and merged them with my address book on my Mac) using vcards as the intermediate format. You'd need to provide more details on what you've tried and why it failed.
  • BioRich Level 1 (65 points)
    I haven't tried it, because I don't want to mess it up, even though I have a backup. Separate lives means they acted independently. They differ by a small number of records.

    Nothing has failed. I'm just curious what the best way about merging 2 databases together is. I don't know if there's software for it, if there's an AppleScript for it, if export/import is the way to go, etc.
  • A.Carlo Level 2 (270 points)
    If you can isolate the records that are different, then just export those specific entries. You can stick them in a group and drag that group out onto your desktop. The group appears as a vcard.

    Backup both address books. Drag the exported group vcard to the destination. Go through the merge dialog that asks whether to combine/keep/replace what it considers duplicates. This will take a while, but it's better than having a badly-integrated result.
  • BioRich Level 1 (65 points)
    Well that's the problem. I can't go through 1600 records manually. I don't have that time. That's why we write software.
  • A.Carlo Level 2 (270 points)
    Unfortunately, the machine would not know if John Q. Public and John Q. Public, Jr are two different people, or the same person, except one entry is missing a suffix. Should the machine merge the two cards? Or should it keep them separate?

    The same problem arises when Jane Doe is now actually Jane Doe-Deer. The machine cannot know if this card should combine with the other card, or if they should remain separate. You would have to tell it, one way or the other.

    Your options are either to deal with this now, or to deal with this incrementally. Dealing with this now would require that you confirm/deny the merge dialog during import. Dealing with this incrementally would have you just dump everything together, and you sort out the duplicates (Card > Look for Duplicates) as you get to them over the course of your use.

    The worst decision would be to let the computer merge all cards that it thinks are duplicates. Trying to separate wrongly-merged contacts afterwards is much harder: you'd need to remember which field belonged to which person, and there's no way to retrieve data that was overwritten during the merge. There's no easy way to do a hands-free, automatic merge of contacts.
  • BioRich Level 1 (65 points)
    Any difference should be considered a difference. That is just remedial.

    I don't mind building a bloated database, but I don't want any merge effort to kill proper data. Other than that, I really don't mind. I don't want to approve 1600 entries, nor do I want the computer to assume. I'd rather it default to a safety, and let me deal with it later.
  • A.Carlo Level 2 (270 points)
    Well, unfortunately, Address Book doesn't have a function to compare then only merge identical cards. Its four import options are Keep Old, Keep New, Keep Both, and Update. The Update option is closest to what you want, but it will assume that contacts with similar fields (like the John Q Public example I gave earlier) are the same person and will combine them into one (I found this out the hard way).

    Your best bet I think would be to export All Contacts for each Address Book as a single vcard (this is the only format that Address Book natively exports), open in a spreadsheet/database program that can compare and merge identical fields, and do the combine there. Address Book can import .csv files, so something like Excel or Araxis Merge (➚) might be able to do it (I don't know if Excel's Merge Workbooks function is applicable in this case).

    Perhaps other people have suggestions on how to only combine identical cards. I don't know programming, so AppleScript and Terminal puts me out of my depth. For what you want to do, Address Book's import/export functions are insufficient by themselves.
  • BioRich Level 1 (65 points)
    I haven't had Excel installed in ages. I have sufficed with Numbers.

    I write scripts, so I might just park this into a quick script. It's no biggy, I just thought there might be something quick that should do the job. Maybe I can write something for people to use. Who knows.

    OK, thanks for the input.

  • Johann Beda Level 1 (0 points)
    I seem to recall someone mentioning that Numbers.app will take a drag and drop of a vcard if that helps any.

    I am about to try doing the same thing with my wife's and my address book. For the most part, I have the "master file" but she has added some unique contacts and possibly updated some contacts that I have not done so. First I am going to make backups of each file, then try outputting a vcard of her data and importing it into mine and then seeing what the various "look for duplicates" and "merge contact" options are going to turn up with out 1100 contacts.