mSecure Converter for 1Password 4

2

Comments

  • MrC
    MrC
    Volunteer Moderator
    edited September 2014

    Edit: the download link is in post #1.

    Hi ocuk,

    OK, great. Download the new script zip archive and extract it. Place the msecure_to_1p4_2_00 folder on your Desktop. Follow the basic instructions in the ReadMe, but note that the script will not create one or more .CSV files, but rather a single 1PIF file which you will import. I'm assuming you're doing this on the Mac; if Windows, let me know and I'll explain how to work there. This will all be in the ReadMe once I get it updated.

    Use the -v option as shown in the ReadMe so the script will tell you how many records are imported and exported (per type). If you run into trouble, send me a PM and we'll go from there.

    Edit: I've updated the archive to include the new ReadMe file. It is a Markdown (.md) file, which doesn't render nicely in the Browser, so I've included a PDF file as well.

  • ocuk
    ocuk
    Community Member

    Wow, mega impressed with your perl skills! Worked like a charm, all records imported, custom mSecure types mapped to notes retaining all fields, all notes (even those with line breaks, non-uniform characters etc.) seem to be intact.

    The only comment I would make is some (in fact most) of my logins have bits missing, URL and username (back from the days I could remember URLs and I only had one username!) and it adds these to the notes section (http://d.pr/i/zYW7/1QWbU2XQ) meaning when I go through and add them I will have to remove the text from the notes, but I will admit thats just me being lazy!

    If I do come across any other issues I will let you know, but as I say after a quick look over what I know to be problem records all seems good!

  • MrC
    MrC
    Volunteer Moderator

    Thanks so much for your warm feedback.

    Sorry about the empty field names being added to notes. Let me fix that and get you an update. There's no reason you should have to waste time cleaning this up. :-)

  • MrC
    MrC
    Volunteer Moderator
    edited September 2014

    The update is now posted at the link in the first post. It avoids writing field names to notes when the field value is empty.

    Be sure to start with an empty vault, or you'll get duplicates when you import again.

  • ocuk
    ocuk
    Community Member

    The new version is great, it produces a cleaner import now the missing fields are excluded. I have had a good look through everything and can't see any other issues, I'm really impressed its handled all the notes on logins, thats one of the reasons I gave up manually formatting the CSV on a previous attempt at a move to 1Password!

    It may be worth a mention to potential users that if you have a custom type (or an edited default type e.g. extra fields added) the entry is treated as a note with field_: for each of the fields with the mSecure type at the top. I would suggest that before mSecure is remove a note (or quick screenshot) is taken of what the fields are then manually update the notes with the fields, otherwise if fields are similar it can be a little confusing knowing which is which.

    I have to say I work in IT and it seems a regular occurrence that things don't work as they should (or in some cases as the vendor says they should) which then requires me to figure out how its working (or not) and fix it, so to have something work and save me time deserves warm feedback! Your efforts are very much appreciated: :)

  • MrC
    MrC
    Volunteer Moderator
    edited September 2014

    Again, thanks, and you're welcome. I've added some text to the ReadMe that explains the issue with customized fields/card types:

    mSecure and Custom Cards and Fields

    The mSecure program does not export to the CSV export file the name of a custom field or customized card type, and as such, these names are not available to the conversion script. After import into 1Password, these field names will be named generically as Field_n (where n is 1, 2, …). Any customized mSecure types will be placed into Secure Notes, since the conversion script does not know how to interpret each field in the CSV. It might therefore be useful to leave mSecure installed until you verify your import data, or take a screenshot or write down the field names and orders of your customized fields and cards, so that you may more easily manage them within 1Password after import.

  • ocuk
    ocuk
    Community Member

    That looks good, it was probably me being a bit over cautious, but figured it was worth a mention as I did have to check a field which was seeming a random number.

  • BennyLava
    BennyLava
    Community Member
    edited September 2014

    Thank you for your work on this script, MrC. I am unfortunately running into a problem with my attempt to run it:

    msecure_to_1p4% /usr/local/ActivePerl-5.16/bin/perl msecure_to_1p4.pl -v ~/Untitled.csv

    **** Hit mSecure CSV quoting bug: row 1, card description '24 hour fitness' - compensating...

    Modification of non-creatable array value attempted, subscript -1 at
    msecure_to_1p4.pl line 339, <$io> line 2 (#1)

    (F) You tried to make an array value spring into existence, and the subscript was probably negative, even counting from end of the array backwards.
    

    Uncaught exception from user code:
    Modification of non-creatable array value attempted, subscript -1 at msecure_to_1p4.pl line 339, <$io> line 2.
    main::import_csv("/Users/mmills/Untitled.csv") called at msecure_to_1p4.pl line 250

  • MrC
    MrC
    Volunteer Moderator

    Hi @BennyLava,

    It looks like you are running on OS X (based on the path names you've mentioned). You should not be using ActivePerl on OS X. OS X has built-in Perl already.

    Give it a try not using ActivePerl (you should uninstall it - you don't need it). You can force the system's Perl using the path:

    /usr/bin/perl5.16

  • BennyLava
    BennyLava
    Community Member

    Thanks for the quick reply, @MrC. I am using OS X Mavericks. I first tried using perl5.16 as installed by MacPorts, which did not work, so I tried ActivePerl. I have now followed your suggestion using /usr/bin/perl5.16, and I get the same error message as I reported above.

  • MrC
    MrC
    Volunteer Moderator

    Can you contact me offline? Me email is at the top of the script. I'll work with you to see what is causing this issue, and if it can be fixed.

    Your data is triggering an mSecure export bug, and my workaround seems to be failing in your case, and I'm not sure why.

  • MrC
    MrC
    Volunteer Moderator

    A quick follow-up. BennyLava and I worked offline to resolve the issues. Here's the summary:

    • The converter had a problem dealing with empty card notes, or card notes that started with a double-quote. This was triggered by improper CSV exports from mSecure.

    • This mSecure wallet had custom card types. I explained via email how to manage these. The converter is flexible in that custom card types can be added to a card / field definitions table. Ask if you have a need for this.

    • This mSecure wallet had custom fields added to stock card types. I explained how to add these additional fields to the card / field definitions table so that the cards could be imported correctly.

    • As I was working out the issues, an update to mSecure for Mac was posted. The new version 3.5.4 finally resolves the CSV export problems mentioned above. This is now the new recommended version.

    I've posted an update to the script and ReadMe. See the download link in post #1.

  • John Smith
    John Smith
    Community Member

    Hello Mr. C

    Im getting a "no such file or directory" in terminal. on on mac mavericks. I've followed the instructions in the pdf. i have both msecure_to_1p4 folder and msecure_export.csv on my desktop.

    thanks

  • MrC
    MrC
    Volunteer Moderator

    Hi John,

    Sorry for the trouble. The problem is that the instructions were recently updated to reflect how AgileBits is storing the password conversion utilities on their GitHub site, and they haven't updated the converter yet to my new version. Just eliminate the "onepassword-utilities" portion of the path. Use, for example:

    cd Desktop/msecure_to_1p4

    Also, please update your mSecure to 3.5.4 (just posted) The updated mSecure should give you good results.

  • John Smith
    John Smith
    Community Member

    Thanks so much for the quick reply @MrC.

    upon using the execute the perl script instructions I'm get a "Uncaught exception from user code:
    Failed to open CSV file: ../../msecure_export.csv: No such file or directory
    Stopped at msecure_to_1p4.pl line 273.
    main::import_csv('../../msecure_export.csv') called at msecure_to_1p4.pl line 250
    Timothys-MacBook-Pro:msecure_to_1p4 timothyruiz$"

    any ideas?
    thanks again

  • MrC
    MrC
    Volunteer Moderator

    Please remove one set of ../ from the path.

  • John Smith
    John Smith
    Community Member

    @mrc you are the man ! worked like a charm.

    Thank you so much !

  • MrC
    MrC
    Volunteer Moderator

    Thanks @John Smith, and you're welcome. I've updated the archive, the README files and the initial post in this thread to reflect the correct path locations.

  • Stefan Leeuwerik
    Stefan Leeuwerik
    Community Member

    Hello MrC,

    Getting the following:

    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 msecure_to_1p4.pl line 21.
    BEGIN failed--compilation aborted at msecure_to_1p4.pl line 21.
    MacBook-Pro-van-Stefan:msecure_to_1p4 stefanleeuwerik$

    Thans,

  • MrC
    MrC
    Volunteer Moderator
    edited September 2014

    Hi Stefan,

    This would indicate that you moved the script out of the folder that contains the Text and other required folders and files such as JSON, UUID, PIF.pm and Utils.pm.

    The folder structure will look like this:

    Be sure yours is the same.

  • Stefan Leeuwerik
    Stefan Leeuwerik
    Community Member

    Hello MrC

    Now i get.... the folder is the same as yours..

    macBook-Pro-van-Stefan:msecure_to_1p4 stefanleeuwerik$ perl msecure_to_1p4.pl -v ../msecure_export.csv
    Uncaught exception from user code:
    Failed to open CSV file: ../msecure_export.csv: No such file or directory
    Stopped at msecure_to_1p4.pl line 273.
    main::import_csv('../msecure_export.csv') called at msecure_to_1p4.pl line 250
    MacBook-Pro-van-Stefan:msecure_to_1p4 stefanleeuwerik$

  • MrC
    MrC
    Volunteer Moderator
    edited September 2014

    Use

    ../../msecure_export.csv

    or

    ~/Desktop/msecure_export.csv

  • MrC
    MrC
    Volunteer Moderator

    Stefan,

    I think I have a method that might be easier for you. See this movie for a convenient (mostly) drag-and-drop way of running the script. You will drag-and-drop certain items into the Terminal window, and it will output the path names for you. Notice where I type in a few parts of the command, and where I drag-and-drop.

  • avhaltere
    avhaltere
    Community Member
    edited September 2014

    Thanks!

  • Stefan Leeuwerik
    Stefan Leeuwerik
    Community Member

    MrC Great it's done :) thank for your help.

  • drtbyk
    drtbyk
    Community Member

    MrC Thank you for this script converter. It did an amazing job and I'm now off of mSecure forever.

  • MrC
    MrC
    Volunteer Moderator

    You're welcome. That's great news, and thank you for the nice feedback!

  • He Run
    He Run
    Community Member
    edited September 2014

    Hi, this script has problem when some mSecure entries contains Chinese characters. Would you help to fix it? Thanks a lot!

  • He Run
    He Run
    Community Member

    No issue. I changed the script and fixed it. Thanks a lot for the script!

  • MrC
    MrC
    Volunteer Moderator

    You're welcome.

    What did you change? Can you send me your updated script at the email address at the top of the script?

This discussion has been closed.