KeePassX Converter for 1Password 4

Options
MrC
MrC
Volunteer Moderator
edited October 2014 in Mac

I've created a script to convert your KeePassX data into a format that can be imported by 1Password 4.

Edit: this version of the converter has been obsoleted. The new and improved version is located here:

https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1

Comments

  • MikeT
    Options

    Hi @MrC,

    Very use tool, thanks so much for working hard on this!

  • Arudmin
    Arudmin
    Community Member
    Options

    It doesnt work for me (KeepassX 0.4.3) so I wrote script.

    Please check it: https://gist.github.com/arudmin/52aec759a8c5d7543e36

  • MrC
    MrC
    Volunteer Moderator
    Options

    Can you tell me what failed for you? I tested it multiple times.

    Your python script using XPath is nice. I'm converting mine to use XPath as well.

  • rheida
    rheida
    Community Member
    edited June 2014
    Options

    Hi, thnx for your tool.
    I followed the instructions.
    I encounter the following message:

    Can't locate Text/CSV.pm in @INC (@INC contains: /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at keepassx_to_1p4.pl line 14.
    BEGIN failed--compilation aborted at keepassx_to_1p4.pl line 14.

    I use KeepassX 0.4.3 and 1password4 version 4.4.1
    Can you tell me what I am doing wrong?

  • MrC
    MrC
    Volunteer Moderator
    Options

    Hi rheida

    The error you are seeing would occur if you had moved the keepassx_to_1p4.pl file to your Desktop, but not the Text folder that was in the archive. If you downloaded with Safari, Safari would have de-archived the zip file automatically, so you probably didn't notice the Text folder that was created. Make sure that Text folder sits along side the keepassx_to_1p4.pl file, and then you can re-run the script.

    *Technically it doesn't matter where the Text folder resides, but the script needs to know where to find it, and instruction-ally, it is easier to advise that users just keep the .pl file and the Text folder in a single location.

  • rheida
    rheida
    Community Member
    Options

    Hi MrC,
    Ahh, that did the trick! Thnx!

  • EricMiller
    EricMiller
    Community Member
    Options

    Hey MrC,

    I followed the instructions and I got a response of "No entries detected". I exported the XML file from KeePass 2.26 on a Windows machine and I'm trying to import into 1Password4 on my Mac.

    I've checked that the XML file is named correctly and populated - 16,005 lines.

    Here's the clip from terminal:
    Macintosh-3:~ ericmiller$ cd Desktop/keepassx_to_1p4
    Macintosh-3:keepassx_to_1p4 ericmiller$ perl keepassx_to_1p4.pl ~/Desktop/keepassx_export.xml
    No entries detected

    Any thoughts on what might be going on?

    Much appreciated!
    Eric

  • MrC
    MrC
    Volunteer Moderator
    Options

    Hi Eric,

    This converter thread (and its accompanying download) is for KeePassX, not KeePass2. I did create a converter for KeePass2 and it is over here:

    https://discussions.agilebits.com/discussion/24909/keepass2-converter-for-1password-4

    Go ahead and give that one a try.

  • Ferret
    Ferret
    Community Member
    Options

    Hi Mr.C

    Hope this thread is still current.

    I'm using KeePassX 0.4.3 and 1Password Version 4.4.1 (441006) Mac App Store.

    I am able to generate the 1P4_import.csv, and it is appropriately placed on the desktop and appears to be correctly populated. However, import under 1Password shows 0 items imported/0 items found.

    The format I'm seeing in the CSV is as follows:

    "Name of Password",,username,password,"Group: GroupName
    bin: AA==
    lastaccess: 2009-10-30T11:53:56
    lastmod: 2010-06-03T08:12:39
    creation: 2008-03-20T18:32:19
    expire: Never"

    Does all this look correct, and have the scripts been tested with 4.4.1?

  • MrC
    MrC
    Volunteer Moderator
    edited October 2014
    Options

    I have a much better version for you to try. I've changed all my converters to be contained in a single package and the CSV export format is deprecated, and instead 1Password's 1PIF format is generated. Would you like to try it out?

  • Ferret
    Ferret
    Community Member
    Options

    Yes please!

  • MrC
    MrC
    Volunteer Moderator
    edited October 2014
    Options

    Ok, great.

    I've uploaded the zip file to my _testing folder in my AgileBits Utilities folder. The file you want is convert_to_1p4.zip. Download, extract and run using similar instructions as to what is in the current ReadMe file (this zip doesn't yet contain the updated documentation).

    The script runs like this:

    perl convert_to_1p4.pl keepassx ~/Desktop/keepassx_export.xml  -v
    

    Note that it is the script's first argument (keepassx) that tells the script what converter module to use. It will create a 1P4_import.1pif file for you on the Desktop, which you import into 1Password. I suggest you make a Backup first of your 1Password database (File > Backup). If you are importing into an existing vault, you might want to create a test vault and see how the data is added to that vault. You can move those items into the main vault when you are satisfied

    Let me know how it works!

  • Ferret
    Ferret
    Community Member
    Options

    As far as I can tell, that worked beautifully. Thanks MrC!

    Are there any logs or outputs I can send that would be helpful to you?

  • MrC
    MrC
    Volunteer Moderator
    edited October 2014
    Options

    If you get nothing but output like:

    Imported 7 cards
    Exported 2 note items
    Exported 5 login items
    Exported 7 total items
    

    then we're good. Good to hear of your success!

  • Ferret
    Ferret
    Community Member
    Options

    That is indeed what I got.

    Thanks again!

  • MrC
    MrC
    Volunteer Moderator
    Options

    This post is to document the new and improved version is now generally available and discussed here:

    https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1

This discussion has been closed.