Import from lastpass has incorrectly categorized wifi passwords [Solved]

schveiguyschveiguy
edited February 22 in Mac

I imported my data from lastpass exporting the data to the CSV, and then importing to 1password.

All my wifi passwords come in as secure notes and not "wireless router" as I would have expected. Is there a way to switch them over to that type?

I also noticed that some of my form fills are in 2x, once as a note, once as an address. But I think it's because I imported both the passwords and the form fills.

Can someone explain how 1password imports stuff? I'm a software developer, and am willing to spend time massaging csv data so it comes out right.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided
Referrer: forum-search:import from lastpass wifi

Comments

  • MrCMrC Community Moderator

    @schveiguy

    Try using the lastpass converter in the converter suite. If necessary, you’ll be able customize it to suit your needs. Follow the direction in the post, and then in the README.

  • ag_anaag_ana

    Team Member

    Hi @schveiguy! Welcome to the forum!

    Let us know if the converter suite fits your needs, and we are here to help should you have any questions :)

  • Hm... I'm following the directions. The perl script seems to have errors:

    Can't use an undefined value as an ARRAY reference at
        /Users/steves/Downloads/mrc-converter-suite/./Utils/Normalize.pm line 78 (#1)
        (F) A value used as either a hard reference or a symbolic reference must
        be a defined value.  This helps to delurk some insidious errors.
    
    Uncaught exception from user code:
        Can't use an undefined value as an ARRAY reference at /Users/steves/Downloads/mrc-converter-suite/./Utils/Normalize.pm line 78.
        Utils::Normalize::normalize_card_data('HASH(0x7ff5709f6450)', 'note', 'ARRAY(0x7ff5707659f0)', 'HASH(0x7ff570765a08)') called at /Users/steves/Downloads/mrc-converter-suite/./Converters/Lastpass.pm line 455
        Converters::Lastpass::do_import('/Users/steves/Downloads/lastpass_export.csv', undef) called at convert.pl line 171
    

    I'm not a perl dev, so I can't help.

  • MrCMrC Community Moderator
    edited February 22

    @schveiguy

    This seems to imply something unexpected in the data. Is it safe to assume this is an unmodified (raw) LastPass export?

    Please enable debug mode and see if that tells us more about what is triggering the error. Add the -d and -v options to the command line. E.g.:

    perl convert.pl lastpass -d -v _TestFiles/lastpass/lastpass_mac.csv
    

    The error is indicating there are no Field / Value pairs found for one of the types (categories). The debug code will tell you which CSV row is triggering the error.

    The first 7 lines of output would also be helpful:

    perl convert.pl lastpass -d -v _TestFiles/lastpass/lastpass_mac.csv | head -7
    

  • Hm... It's a wifi password. Here is the information:

    http://sn,,XXXXXXX,"NoteType:Wi-Fi Password
    SSID:ZN102
    Password:XXXXXXX
    Connection Type:
    Connection Mode:
    Authentication:
    Encryption:WEP
    Use 802.1X:
    FIPS Mode:
    Key Type:
    Protected:
    Key Index:
    Notes:",ZN102,Secure Notes,0

    (I replaced the password portions with XXXXXX)

    All my wifi passwords are in this form (and interestingly, those are the ones that don't come across correctly).

  • MrCMrC Community Moderator
    edited February 22

    @schveiguy

    That runs perfectly fine for me:

  • Looks like it's the "Notes" that aren't handled in the Perl script.

  • MrCMrC Community Moderator

    @schveiguy

    Sorry, what am I misunderstanding?

  • schveiguyschveiguy
    edited February 22

    This is how it looks for me (with the standard import in 1password):

    And the perl script has the error as reported.

  • MrCMrC Community Moderator

    Are we talking about two different things, @schveiguy ?

    Let's ignore what the native 1Password is doing, I can't help there.

    We were trying to get the converter to convert for you, and you mentioned you were getting the Perl error above.

    If you're saying that all those empty fields are not present in the lastpass converter's output, that's because they have no value, so have no purpose. The converter never creates empty Field/Value pairs.

  • Ugh, sorry for the confusion. I went to line 1074, NOT row 1074 (which doesn't include the header). The ZN102 import works (I created a new csv with just that one line). Will post some updates in a minute, I want to try diagnosing further.

  • Oh, and duh, it's not line 1074 as this CSV has line continuations....

    The one that is failing is a custom note I made for something that had no default template (It's a password for an excel file).

    Here is the record that is failing (I modified to remove the password and other info, and it still fails as before):
    http://sn,,,"NoteType:Custom_120350430747748241
    password:XXXXXXXX",YYYYYY excel unlock,Business/Admin,0

    And here is the debug output:

    main                : Runninng script from '/Users/steves/Downloads/mrc-converter-suite'
    main                : Command Line: -d -v --tags lpexport lastpass badexport.csv
    main                : Output file: /Users/steves/Desktop/1P_import.1pif
    print_fileinfo      : Input file info: "badexport.csv"
    print_fileinfo      :   size: 150
    print_fileinfo      :   kind: ASCII text
    print_fileinfo      :   mime: text/plain; charset=us-ascii
    do_import           : ROW: 1
    pull_fields_from_note: Custom note type: Custom_120350430747748241
    pull_fields_from_note:    Unmatched
    do_import           :       type determined as 'note'
    normalize_card_data : field: password
    Can't use an undefined value as an ARRAY reference at
        /Users/steves/Downloads/mrc-converter-suite/./Utils/Normalize.pm line 78 (#1)
        (F) A value used as either a hard reference or a symbolic reference must
        be a defined value.  This helps to delurk some insidious errors.
    ...
    

    Sorry for the goose chase, I'm not used to CSV files where the line number is not the record number.

    I have very few of these custom notes, I can probably remove them for the import...

  • Removing all custom items worked, so I now have a better import, including wifi passwords. Thanks!

  • MrCMrC Community Moderator

    @schveiguy ,

    Your post has shown me a bug with custom items - I'm examining that now.

    We'll be able to add a custom field definition to the table at the top of Converters/Lastpass.pm, so that you can handle those types.

    Give me a few minutes to see what I'm doing wrong in the case where you have custom items, but there is no definition for these.

  • MrCMrC Community Moderator
    edited February 22

    @schveiguy

    Ok, I've resolved the issue and have updated the converter suite.

    Somehow I'd introduced a bug that occurred with lastpass and custom types, and you're the first to find it. My own test files showed the bug also.

    And if you want custom fields:

    If you wouldn't mind updating, and trying the conversion again, it would be nice to have another test case run.

    If you want even better handling of your custom types, we just need to add new definitions to the %card_field_specs table at the beginning of Converters/Lastpass.pm.

    For example, maybe you want the password stored as concealed text.

  • schveiguyschveiguy
    edited February 22

    Hm... I actually deleted all my CSV files (I don't like having all my passwords being backed up in clear text on my time machine drive). But I can do it again pretty quickly... stand by.

  • Import worked this time. Of course those passwords came in as notes, which makes sense. Providing e.g. a custom way to map those would be nice. So for instance, when I added all those, lastpass didn't have a way to just store a username/password without a site attached to it. So I created a custom template for those (which is why I have those custom items).

    Or, is there a way to convert a secure note to another type afterwards in 1password? This would be helpful. You can see that a secure note with a "password" field doesn't protect visibility properly.

  • MrCMrC Community Moderator

    @schveiguy

    There's no way to convert from one type to another in 1Password (except a Password can be promoted to a Login). So, let's get this right during the conversion. This added code to Converters/Lastpass.pm

        mylogin =>                  { textname => 'Custom_120350430747748241', type_out => 'login', fields => [     # special handling
            [ 'username',           0, 'username' ],
            [ 'password',           0, 'password' ],
            [ 'url',                0, 'url' ],
        ]},
    

    as shown here:

    produces this:

    Is that what you want?

  • Honestly, I'm good now. I had only 6 of those, so I just removed them from the CSV file and recreated them by hand in 1password. But thank you for the information!

  • MrCMrC Community Moderator

    Cheers, @schveiguy

    Enjoy 1Password!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file