Bug 424940

Summary: Add support for importing Windows contacts from .contact XML files
Product: [Applications] kaddressbook Reporter: Skylar Ittner <skylar>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: montel, tokoe
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 5.16.0
Attachments: Sample Windows contact file with name and email address
Sample .contact file with name and email address
Sample .contact file with separate fields for name, last name, and first name
Sample .contact file for a contact with only an email (no name)
Sample .contact file for a contact with an embedded base64-encoded .BMP profile picture

Description Skylar Ittner 2020-08-02 19:05:58 UTC
Created attachment 130588 [details]
Sample Windows contact file with name and email address

Windows has a Contacts folder in the user's "home folder" that contains files with the extension .contact.  Each file is a single contact's information stored in XML format.

I'm currently attempting to migrate these contacts over from a broken Windows install to Linux for a client, but there don't seem to be any tools capable of converting.  It would be great if kaddressbook supported reading this format.

Here is Microsoft's schema: https://docs.microsoft.com/en-us/previous-versions//ms735869(v=vs.85)
Comment 1 Laurent Montel 2020-08-03 05:54:12 UTC
Good idea indeed.
But it seems that windows 10 doesn't store contacts here.
But I will add this support in kaddressbook.

Do you use windows 10 ?
With which application ?
Regards
Comment 2 Laurent Montel 2020-08-03 06:09:02 UTC
Git commit 77ccb3e742d09ad35ec87e5c1ed49fb2ff184021 by Laurent Montel.
Committed on 03/08/2020 at 06:08.
Pushed by mlaurent into branch 'master'.

Start to implement windows-contacts import/export support

M  +1    -1    kaddressbook/importexportplugins/CMakeLists.txt
A  +20   -0    kaddressbook/importexportplugins/windows-contacts/CMakeLists.txt
A  +12   -0    kaddressbook/importexportplugins/windows-contacts/kaddressbook_importexportwindowscontactplugin.json
A  +46   -0    kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugin.cpp     [License: GPL (v2+)]
A  +37   -0    kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugin.h     [License: GPL (v2+)]
A  +84   -0    kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugininterface.cpp     [License: GPL (v2+)]
A  +40   -0    kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugininterface.h     [License: GPL (v2+)]

https://invent.kde.org/pim/kdepim-addons/commit/77ccb3e742d09ad35ec87e5c1ed49fb2ff184021
Comment 3 Laurent Montel 2020-08-04 05:54:49 UTC
Hi,
could you told me which apps do you use ?
Or sending me in private others contact file please ?
I need more testcase.

Thanks
Comment 4 Skylar Ittner 2020-08-05 04:34:27 UTC
I actually use Linux full-time, but I encounter contacts folders when migrating clients over to Linux. I believe Outlook and some other Microsoft apps used to store contacts in there. Windows 10 does not, opting instead to use the People app which, while being a desktop app, requires logging into a web version to export contacts.

The main reason this is valuable is because all the people who upgraded from Windows 7 to Windows 10 have a contacts folder, and it's not unlikely that there are contacts in it that they might want in the event they switch to Linux or require data recovery. I opened this feature request after a client came to me with an old laptop running Windows 10 on a failing drive with several hundred contacts in the folder.

I'm attaching some contact files with the real info replaced in a text editor.
Comment 5 Skylar Ittner 2020-08-05 04:35:20 UTC
Created attachment 130646 [details]
Sample .contact file with name and email address
Comment 6 Skylar Ittner 2020-08-05 04:36:14 UTC
Created attachment 130647 [details]
Sample .contact file with separate fields for name, last name, and first name
Comment 7 Skylar Ittner 2020-08-05 04:37:14 UTC
Created attachment 130648 [details]
Sample .contact file for a contact with only an email (no name)
Comment 8 Skylar Ittner 2020-08-05 04:38:16 UTC
Created attachment 130649 [details]
Sample .contact file for a contact with an embedded base64-encoded .BMP profile picture
Comment 9 Laurent Montel 2020-08-05 04:58:15 UTC
(In reply to Skylar Ittner from comment #4)
> I actually use Linux full-time, but I encounter contacts folders when
> migrating clients over to Linux. I believe Outlook and some other Microsoft
> apps used to store contacts in there. Windows 10 does not, opting instead to
> use the People app which, while being a desktop app, requires logging into a
> web version to export contacts.
> 
> The main reason this is valuable is because all the people who upgraded from
> Windows 7 to Windows 10 have a contacts folder, and it's not unlikely that
> there are contacts in it that they might want in the event they switch to
> Linux or require data recovery. I opened this feature request after a client
> came to me with an old laptop running Windows 10 on a failing drive with
> several hundred contacts in the folder.
> 
> I'm attaching some contact files with the real info replaced in a text
> editor.

Ok as I only windows 10 I can't have more test.
But thanks a lot for your test case it will be very useful !
I will continue to implement it.

Regards
Comment 10 Laurent Montel 2020-08-05 06:22:34 UTC
Git commit 1bad745a3273cc16d5deb1d12288427870c11eeb by Laurent Montel.
Committed on 05/08/2020 at 06:20.
Pushed by mlaurent into branch 'master'.

Continue to implement it

M  +1    -1    kaddressbook/importexportplugins/windows-contacts/autotests/CMakeLists.txt
M  +5    -4    kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp
M  +2    -1    kaddressbook/importexportplugins/windows-contacts/importwindowcontact.h
M  +10   -2    kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugininterface.cpp

https://invent.kde.org/pim/kdepim-addons/commit/1bad745a3273cc16d5deb1d12288427870c11eeb
Comment 11 Laurent Montel 2020-08-05 11:16:42 UTC
Git commit cc642462c4a57e32e02e7feb9b65bf764624421b by Laurent Montel.
Committed on 05/08/2020 at 11:15.
Pushed by mlaurent into branch 'master'.

Now we can import address/name

M  +46   -2    kaddressbook/importexportplugins/windows-contacts/autotests/importwindowcontacttest.cpp
M  +56   -4    kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp
M  +2    -2    kaddressbook/importexportplugins/windows-contacts/importwindowcontact.h

https://invent.kde.org/pim/kdepim-addons/commit/cc642462c4a57e32e02e7feb9b65bf764624421b
Comment 12 Laurent Montel 2020-08-06 06:01:55 UTC
Git commit a9e7aff1e08cb77c40ccc350b8b5fc4195f05ea3 by Laurent Montel.
Committed on 06/08/2020 at 06:01.
Pushed by mlaurent into branch 'master'.

Fix Bug 424940 - Add support for importing Windows contacts from .contact XML files
FIXED-IN: 5.16.0

M  +27   -0    kaddressbook/importexportplugins/windows-contacts/autotests/importwindowcontacttest.cpp
M  +18   -17   kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp

https://invent.kde.org/pim/kdepim-addons/commit/a9e7aff1e08cb77c40ccc350b8b5fc4195f05ea3
Comment 13 Laurent Montel 2020-08-06 06:03:06 UTC
I implemented import support.
If you have some testcase with IM address or physical address or phone number etc you can send me it so I can confirm that all works as expected.

Thanks.