Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > any unix gurus here? I have thousands of duplicate groups in Contacts, need to delete

any unix gurus here? I have thousands of duplicate groups in Contacts, need to delete
Thread Tools
chasg
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 07:44 PM
 
Hi All,

I have thousands of duplicate Groups in Contacts on OSX, and I need to delete them (they are now showing up on my iPhone, and slowing it waaaay down).

The story: a long time ago, back in the .Mac or .Me days, Apple started to let us back up to their online servers. Once in a while, and I can't remember why, I would get asked if I wanted to merge my existing contacts with those online (if I remember correctly, it had something to do with being logged in to the online system with more than one method e.g. phone number and .mac address...I think...).

Be that as it may, each time I merged, everything got duplicated. I noticed that my contacts were mysteriously duplicating, and I got rid of those with various scripts and apps (fiddly, but doable). What I didn't notice was my one Group duplicating, and eventually there were thousands of copies.

This has been messing up my Mac's Contacts app for years, so much so that I never use it any more. It wasn't a problem on any of my iPhones until iOS 10, for some reason. Now all those groups are on my present phone (iPhone 7 Plus), and looking up any phone number, name or email can take up to 30 seconds, often with incomplete results. Maddening.

I need to remove all those groups, but I've never found a utility designed to do it. Manually removing them isn't an option, if I choose one in Contacts on OSX and hit "delete", it can take up to a minute for it to actually delete. Multiply this by thousands, and you can see my problem.

I know that I can open the database in a text editor, but I'm not expert enough to be able to choose the right data to remove to get rid of all those !@£$£!! groups!

Can anyone give me some guidance? (fyi: all the duplicated groups are called "Quicklist").

Many thanks in advance for any help!

Chas
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 6, 2017, 08:06 PM
 
If the database is not a common or known format, I don't think there is anything that can be done. Do you know if the format is an open standard like SQLite, or something proprietary? Are individual records still vcards?
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 08:28 PM
 
LOL! The answer to all of your questions (thanks for contributing, by the way) is: "umm, what?" Seriously, I have no idea, I have no database experience beyond filing them after they've been created.

The actual Contacts file ends with ".abbu", and it actually contains a ton of files in numerous folders (including lots of jpegs). Hmm, one of the text files, ending with .abcddb has the line: "SQLite format 3@ «´ pH«´-‚Ò`˚ˆÒÏK´RD#Ê " at the top. A familiar word! :-)

Not quite sure where to go from here. What I really need is someone who knows what's going on inside a .abbu file. Surely the Groups are ID'd clearly (what I was hoping was for a simple search and replace, or perhaps some grep action, not that I remember much about grep anymore, not used it for about 20 years, LOL).
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 6, 2017, 08:32 PM
 
I suggest trying to open this file with an SQLite editor like this one:

DB Browser for SQLite

I haven't tried this, so I offer no promises. Make sure you work with a copy, but if the DB format is a pure SQLite format and not some weird Apple bastardized format, hopefully this will help?
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 08:34 PM
 
Hey, thanks!

Time to learn about databases :-)
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 08:37 PM
 
Rats, the app can't see any files it can open :-(

It was a good suggestion, I really appreciate it.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 6, 2017, 08:43 PM
 
Perhaps you could try changing the file extension of the file you are trying to open to something that the app will recognize?
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 08:50 PM
 
I dug a little deeper, and the app is requesting a decryption key to open any of the files ending with .abcddb My OSX password doesn't work (I don't get an error, just the password dialog showing up again immediately).

Interestingly, my text editor can open these .abcddb files, and all of the ones I've looked through do contain the string "quicklist" (remember, this is the name of all of the groups I'd like to get rid of). There are 9106 of these files.

I'm thinking of just deleting them, and seeing what happens. My only concern is that perhaps they are being referenced from yet another file, and them missing will cause all heck to break out (I can't find this mythical file, though, but surely they are being referenced somehow, they are showing up in the application Contacts).

Learning and solving at the same time is very challenging...
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 6, 2017, 09:01 PM
 
Ahh, well unless you know the encryption cipher and have access to the encryption keypair, you are unfortunately out of luck.
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 6, 2017, 09:04 PM
 
Yeah, I'm beginning to think that :-/

Strange the SQL app won't open them, but I can see their contents with a text editor.
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 7, 2017, 09:33 AM
 
A miracle has occurred! I got rid of all the groups, and couldn't have done it without you :-)

Right, just in case some other soul has this problem, I'll lay out the final details here.

1) @besson3c was entirely right: the database is a SQL variant, which I could access with "DB Browser for SQL Lite" (linked above).
NOTE: I of course made a copy of the original, stored it elsewhere, and didn't work on that. I did my work on a different copy (not in the Library folder), and each time I thought I'd cracked it, I'd copy that entire Address Book folder into Application Support. Luckily I did, as I did screw up a few times and had to start from scratch from the vanilla copy.

2) the database in question is located in ~/library/Application Support/Address Book (note: I'm running Yosemite OSX 10.10.5, this database might be be somewhere else for different versions of OSX)

3) the database's name is "AddressBook-v22.abcddb"

4) in DB Browser, I navigated to a subsection of the database designated: "ZABCDRECORD" (sorry, I don't know the terms of what I actually found, I think it's a "Table"...I think)

5) I had to scroll to the right a bit to find the header that contained all of my offending "Quicklist" groups, this header was "ZNAME"

6) I then just had to select all of the offending records (shift-click on the far left numerical line/title/thing) and click the "Delete Record" button in the upper left of the window. There were almost 10,000 duplicates of this record, it took a while to delete

7) I then clicked "Write Changes" (top of window)

8) I then copied this the entire Address Book folder into Application Support (after trashing the Address Book folder already in there, so it wasn't deleted by replacement) and restarted my Contacts Application.

That's when the miracle occurred: no more duplicate groups, I'm so happy!

Now, the problem is: how do I designate this the definitive database, and upload it to iCloud and then down to my iDevices (last thing I want is for all those zillions of duplicated groups to be copied back down from iCloud to my Mac!).
     
chasg  (op)
Grizzled Veteran
Join Date: Mar 2000
Location: London
Status: Offline
Reply With Quote
Feb 7, 2017, 10:43 AM
 
Ok, iCloud brought back all the Quicklist groups (expected). At least alterations to Contacts now show up on my phone and Mac as they are supposed to now (this was never happening before).

The problem: all the Quicklist Group records are no longer in ZABCDRECORD of AddressBook-v22.abcddb. Where are they?? They have to be in a database somewhere, because I can see them in Contacts.

Now I'm stumped.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:09 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,