MrC's Convert to 1Password Utility (mrc-converter-suite)

Options
1343537394052

Comments

  • MrC
    MrC
    Volunteer Moderator
    Options

    @jlynch3sf ,

    The first hurdle is get those iCloud Keychain entries into a Local vault. If that cannot be accomplished, then there's no hope.

    If you can get the items into a local vault, then the security command should be able to export them. However, this will be cumbserome, since macOS High Sierra now requires entering your password for every item. And last time I checked, there were bugs preventing the AppleScript to press the Allow button from working.

    See if this can get you moving forward.

    It appears Apple may be abandoning AppleScript and automation technologies. They have been stale for years, and their lead automation technologies left the company. I'll spend a little time trying to get something to work for the latest update, but it is likely to end fruitless.

  • jlynch3sf
    jlynch3sf
    Community Member
    Options

    I've been messing around with a bunch of sample scripts trying to automate that button press... very frustrating...

  • redbeard20
    redbeard20
    Community Member
    Options

    Hi MrC - I'm using 1P 6.8.4 on MacOS High Sierra. Trying to import from Clipperz using your utility. I get the following message:

    Daniels-MacBook-Pro:convert_to_1p4 teardrop$ cd '/Users/teardrop/Desktop/convert_to_1p4' && /usr/bin/perl convert_to_1p4.pl clipperz '/Users/teardrop/Desktop/clipperz.html' -v
    Uncaught exception from user code:
        malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<html><head><title>C...") at Converters/Clipperz.pm line 69.
        JSON::PP::decode_error('malformed JSON string, neither array, object, number, string ...') called at /System/Library/Perl/5.18/JSON/PP.pm line 1045
        JSON::PP::word() called at /System/Library/Perl/5.18/JSON/PP.pm line 728
        JSON::PP::value() called at /System/Library/Perl/5.18/JSON/PP.pm line 688
        JSON::PP::PP_decode_json('JSON::PP=HASH(0x7f8327bd7788)', '<html><head><title>Clipperz data</title><style type="text/css...', 0) called at /System/Library/Perl/5.18/JSON/PP.pm line 148
        JSON::PP::decode('JSON::PP=HASH(0x7f8327bd7788)', '<html><head><title>Clipperz data</title><style type="text/css...') called at /System/Library/Perl/5.18/JSON/PP.pm line 110
        JSON::PP::decode_json('<html><head><title>Clipperz data</title><style type="text/css...') called at Converters/Clipperz.pm line 69
        Converters::Clipperz::do_import('/Users/teardrop/Desktop/clipperz.html', undef) called at convert_to_1p4.pl line 125
    Daniels-MacBook-Pro:convert_to_1p4 teardrop$ 
    

    Any ideas what's going wrong? No output file is produced.

  • MrC
    MrC
    Volunteer Moderator
    edited November 2017
    Options

    Hi @redbeard20 ,

    It appears your export data is HTML (and not the required JSON). How did you export?

    Did you follow the directions in the README.pdf for exporting the Clipperz data (in the section Exporting from your Password Manager)?

    Which version of Clipperz are you using?

  • redbeard20
    redbeard20
    Community Member
    Options

    As you note in the readme.pdf, Clipperz doesn't seem to have versions in the conventional sense. It seems they make updates every now and then, but perhaps since it's only a web service, there aren't version numbers (that I can find, anyway). When I click on export in Clipperz it shows the following message:

    HTML + JSON
    Download a printer-friendly HTML file that lists the content of all your cards.
    This same file also contains all your data in JSON format. Please note that file attachments are not included.
    Beware: all data are unencrypted! Therefore make sure to properly store and manage this file.
    download HTML+JSON

    When I click on the link (in Safari) it opens a new window with what looks like all of my password information in heavily marked up HTML. I just tried copying that text and put it in TextEdit, saved as pm_export.txt. Then I run the AppleScript Conversion Helper (select Clipperz, then no additional options) and try to convert and get the error message above.

    It seems Clipperz now combines HTML and JSON in one file, while the converter is maybe built to just handle JSON from Clipperz?

  • MrC
    MrC
    Volunteer Moderator
    Options

    @redbeard20 ,

    It appears Clippzerz has changed their export. Let me take a look. Hold tight...

  • MrC
    MrC
    Volunteer Moderator
    Options

    Hi @redbeard20 ,

    I've just posted an update to the 1.10 version - it is in Testing Bits, mentioned in the first post of the converter suite thread.

    Download that and see how it works for you. The README.pdf was updated to reflect the current export procedure.

  • redbeard20
    redbeard20
    Community Member
    Options

    Works. Thank you!!!

  • MrC
    MrC
    Volunteer Moderator
    Options

    Thanks for the update @redbeard20 - enjoy 1Password!

  • PiperD
    PiperD
    Community Member
    Options

    I'd like to convert to 1Password. I'm currently using eWallet 8.3.9 on Android. I don't even see an export option in eWallet - am I SOL?

    Thanks.

  • MrC
    MrC
    Volunteer Moderator
    Options

    @PiperD ,

    You would need to sync your data to a desktop version of eWallet, and export from there.

  • PiperD
    PiperD
    Community Member
    Options

    @MrC OK thanks!

  • 1pnoob
    1pnoob
    Community Member
    edited January 2018
    Options

    Hi MrC -- I'm trying to run your converter on Windows 7, but Strawberry perl is giving me an error. Any ideas? Thank you!

    c:\Strawberry\win32>perl \\myServer\allUsers$\abc\Desktop\convert_to_1p4\convert_to_1p4.pl passwordsafe -v ..\abc.dat
    Can't locate Utils/PIF.pm in @INC (you may need to install the Utils::PIF module) (@INC contains: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib) at \\myServer\allUsers$\abc\Desktop\convert_to_1p4\convert_to_1p4.pl line 15.
    BEGIN failed--compilation aborted at \\myServer\allUsers$\abc\Desktop\convert_to_1p4\convert_to_1p4.pl line 15.
    
  • MrC
    MrC
    Volunteer Moderator
    Options

    @1pnoob ,

    Please use the 1.10 version of the converter suite - it is in Testing Bits, mentioned in the first post of this thread.

  • 1pnoob
    1pnoob
    Community Member
    Options

    Thanks, MrC. A note for your documentation: passwordsafe offers several formats for export; only XML will work.

  • MrC
    MrC
    Volunteer Moderator
    Options

    Hi @1pnoob ,

    The README.pdf says:

    ● Password Safe
    Launch Password Safe, and export its database to an XML file using the File > Export To... > XML Format... menu item. Enter your password in the Current Safe Combination area. Click the Export file button to the right of the path entry area, navigate to your Desktop folder, and enter the name pm_export.xml in the File name field in the dialog, and click the Save button, and the finally, click the Export XML button to create the export file on your Desktop. Click the Finish button to close the export dialog. The name of your name_of_export_file will be pm_export.xml. You may now quit Password Safe.

  • Tajgeer
    Tajgeer
    Community Member
    Options

    Hello there!

    It's my first post, as I recently (about 30 minutes ago) started using 1Password. I was afraid of exporting iCloud and login credentials as I saw posts about security changes and wasn't pleased by vision of "manually" entering password in every popup.

    However, I was able to find new AppleScript which works very well on recent macOS version (High Sierra 10.13.2). You might want to check it out @MrC and maybe update your README file.

    https://gist.github.com/rmondello/b933231b1fcc83a7db0b#gistcomment-2272755

    Thanks for your converter! :)

  • MrC
    MrC
    Volunteer Moderator
    Options

    Thanks @Tajgeer - I'll take a look sometime this week.

  • peter_jm
    peter_jm
    Community Member
    Options

    Having some issues with converting on windows 10. Received the following error after trying to carefully follow your instructions.

    Looked initially like I was in good shape after running your install script:
    All tests successful.
    Files=51, Tests=3381, 6 wallclock secs ( 0.19 usr + 0.11 sys = 0.30 CPU)
    Result: PASS
    STBEY/Date-Calc-XS-6.4.tar.gz
    C:\myperl\c\bin\gmake.exe test -- OK
    Running make install
    "C:\myperl\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- XS.bs blib\arch\auto\Date\Calc\XS\XS.bs 644
    Files found in blib\arch: installing files in blib\lib into architecture dependent library tree
    Installing C:\myperl\perl\site\lib\auto\Date\Calc\XS\XS.xs.dll
    Installing C:\myperl\perl\site\lib\Date\Calc\XS.pm
    Installing C:\myperl\perl\site\lib\Date\Calc\XS.pod
    Appending installation info to C:\myperl\perl\lib/perllocal.pod
    STBEY/Date-Calc-XS-6.4.tar.gz
    C:\myperl\c\bin\gmake.exe install UNINST=1 -- OK

    However - when trying to execute the conversion from ewallet - got this:
    C:\WINDOWS\system32>perl convert_to_1p4.pl ewallet -v ..\pm_export
    Can't open perl script "convert_to_1p4.pl": No such file or directory

    Any thoughts on what I might have done wrong? The convert folder and my export folder are both on the desktop.

    Thanks! Peter

  • MrC
    MrC
    Volunteer Moderator
    edited January 2018
    Options

    @peter_jm

    Please use the 1.10 version in Testing Bits, mentioned in the first post of the converter suite thread.

  • peter_jm
    peter_jm
    Community Member
    Options

    Thanks will do - much appreciated!! I'll get back to you on my success.

  • scwtech
    scwtech
    Community Member
    edited January 2018
    Options

    Thanks @Tajgeer though I'm still unable to copy/paste the icloud entries into a new local keychain on high sierra. this script:

    tell application "System Events"
        repeat while exists (processes where name is "SecurityAgent")
            tell process "SecurityAgent"
                set frontmost to true
                if (count of windows) > 0 then
                    set window_name to name of front window
                end if
                try
                    keystroke "PASSWORD"
                    delay 0.1
                    keystroke return
                    delay 0.1
                on error
                    -- do nothing to skip the error
                end try
            end tell
            delay 0.5
        end repeat
    end tell
    

    works for the local keychain, but the paste operation (I tested it with a single entry) requires first the icloud password and then the local-icloud password (which I've changed to be different from the icloud password). I suppose I could make them both the same, temporarily, but was hoping for a two-step script that would allow for two different passwords.

  • peter_jm
    peter_jm
    Community Member
    Options

    MrC - should I go through the perl install again from scratch (delete the c: directory created before)? I just briefly tried using the new testing bits v 1.1 and go this:
    C:\WINDOWS\system32>%USERPROFILE%\Desktop\convert_to_1p4\install_modules.bat

    C:\WINDOWS\system32>echo cpan Text::CSV XML::XPath Date::Calc
    cpan Text::CSV XML::XPath Date::Calc

    C:\WINDOWS\system32>cpan Text::CSV XML::XPath Date::Calc
    Loading internal null logger. Install Log::Log4perl for logging messages
    CPAN: CPAN::SQLite loaded ok (v0.211)
    Database was generated on Sun, 14 Jan 2018 23:57:37 GMT

    CPAN: Module::CoreList loaded ok (v5.20170923)
    Text::CSV is up to date (1.95).
    XML::XPath is up to date (1.42).
    Date::Calc is up to date (6.4).

    C:\WINDOWS\system32>perl convert_to_1p4.pl ewallet -v ..\pm_export
    Can't open perl script "convert_to_1p4.pl": No such file or directory

  • Tajgeer
    Tajgeer
    Community Member
    Options

    @scwtech

    I think that you can always do something like this and it SHOULD work:

    try
        keystroke "ICLOUD PASSWORD"
        delay 0.1
        keystroke return
        delay 0.5
        keystroke "LOCAL ICLOUD PASSWORD"
        delay 0.1
        keystroke return
        delay 0.5
    on error
        -- do nothing to skip the error
    end try
    
  • scwtech
    scwtech
    Community Member
    Options

    ok, I changed the local-icloud password to match the icloud password temporarily and the script mostly worked. After two errors (see attached) I only got 376 entries of over 1200. Not sure this is the right way to do this :(

    this error was bypassable:

    this one killed the process:

  • Tajgeer
    Tajgeer
    Community Member
    Options

    The bypassable error occured to me to (as far as I remember two times) but it didn't have any impact on export process at all - all items were exported.
    As for the second one - sorry, I'm afraid I can't help you, I don't know what is the cause :(

  • scwtech
    scwtech
    Community Member
    Options

    I was able to copy and paste 10 items (decided to start small for this experiment) by unlocking the local-icloud keychain before I started the process and by using the original script. But, when the process completed, the script kept running and started pasting my password into whatever app/window (including the script editor) was on top. I'll keep trying!

  • scwtech
    scwtech
    Community Member
    Options

    It seems that the content of the entries being pasted affects the ability of the script to run successfully. I twice tried pasting a group of 30 website logins and it failed at 17. I tried to paste 30 SSID entries and the process completely successfully.

  • scwtech
    scwtech
    Community Member
    Options

    was able to paste all 411 airport network passwords (as keychain calls them) without error. I think small groups, carefully and slowly, will be the only way to do this.

  • MrC
    MrC
    Volunteer Moderator
    Options

    @peter_jm

    Be sure you have closed the portableshell.bat command window before you try using the 1.10 version. If you have that console window open, and are in the old directory (which you've likely tossed into the trash and replaced), it will be stale.

    You don't need to reinstall the perl modules, but the install script does change directories for you. When you open a new instance of portableshell.bat, be sure to first change its directory with:

    cd %USERPROFILE%\Desktop\convert_to_1p4
    

    and then run the conversion.

This discussion has been closed.