How do I export one time passwords as well as passwords

miguelvega
miguelvega
Community Member

I would like to export one time password fields as well as passwords, but he file created doesn't include them.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided
Referrer: forum-search:How do I export one time passwords as well as passwords

Comments

  • miguelvega
    miguelvega
    Community Member

    I would like to export one time password fields as well as passwords, but he file created doesn't include them.

  • ag_ana
    ag_ana
    1Password Alumni

    Hi @miguelvega! Welcome to the forum!

    On what platform are you trying to export your data?

  • miguelvega
    miguelvega
    Community Member

    Hi, I got it working.

  • ag_ana
    ag_ana
    1Password Alumni

    Great, thank you for the update @miguelvega!

    If you have any other questions, please feel free to reach out anytime.

    Have a wonderful day :)

  • Pacifica
    Pacifica
    Community Member

    I would like to do the same. How did you do it?

  • ag_ana
    ag_ana
    1Password Alumni

    @Pacifica:

    Same question for you: what platform are you trying to export from? Mac or Windows?

  • Pacifica
    Pacifica
    Community Member

    Mac

  • ag_ana
    ag_ana
    1Password Alumni

    @Pacifica:

    Thank you for the confirmation! Are you selecting All fields when you export your data?

  • Pacifica
    Pacifica
    Community Member

    yes

  • MrC
    MrC
    Volunteer Moderator
    edited April 2021

    @ag_ana / @Pacifica

    It appears the CSV export is not including custom fields, so your OTP secret, which you would have created as a custom field, is not exported. A 1PIF export does contain this data.

  • Pacifica
    Pacifica
    Community Member

    So how do I get this data? Not possible?

  • MrC
    MrC
    Volunteer Moderator

    @Pacifica

    What is your ultimate purpose for the export?

  • Pacifica
    Pacifica
    Community Member

    Import into an OTP app to use as a back up.

  • MrC
    MrC
    Volunteer Moderator
    edited May 2021

    @Pacifica

    In that case, you can use the onepif converter from the converter suite, formatting with the csv formatter. Example:

    which produces:

    You don't need the -d (debug) option. I added that so you could see the exported values.

    The converter suite link posted above will get you started.

  • bohn007
    bohn007
    Community Member

    Hey @MrC

    Wanted to first thank you for creating such an amazing conversion tool and supporting all those who use it!

    like others in this thread I am trying to pull an export of all logins that have a one-time password field filled in.

    I am having some trouble converting a onepif file to a csv. When running the command you listed above I am met with the following error Error: failed to load converter module 'onepif'

    I tried running the conversion without onepif as the . using the following command "perl convert.pl csv " but am met again with another error message: CSV_PP ERROR: 2034 - EIF - Loose unescaped quote @ rec 0 pos 2 field 1

    Wondering if you have come across this before or have an idea of what I am doing wrong. Thanks!

  • MrC
    MrC
    Volunteer Moderator
    edited August 2021

    Hi @bohn007 ,

    Thanks for the kind words.

    Which 1Password version, and which platform are you exporting / converting from?

  • bohn007
    bohn007
    Community Member

    Hey @MrC

    Dang you are quick!

    I exported the file from the 1Password app running version 7.8.7 and I am on Macos BigSur 11.4.

    If I could I would simply export the file as a CSV and extract which logins have one-time password fields active but judging from prior comments it looks like I need to export the file as a .1pif and then convert it to a csv.

  • MrC
    MrC
    Volunteer Moderator
    edited August 2021

    @bohn007

    I happened to be reading email when yours popped up, so your timing was excellent!

    1Password for Mac unfortunately is not exporting custom fields in the CSV . It does export them using 1PIF, and the TOTP is there. Example using the onepif converter with the csv format:

    This particular converter was never really designed for wide usage - it was designed to allow printing of data in various formats, for those that routinely required this. You can use it, but it requires installation of a couple of extra Perl modules. And on a Mac, this will take some work on your part, since native macOS does not include these modules. To get them, you need the development environment installed: XCode, XCode's command line tools, and an environment like MacPorts, and then finally the appropriate Perl modules can be installed. This is the only converter that uses / requires modules outside the native macOS Perl environment. I suppose some day I should write a 1PIF to CSV converter that works with the native macOS Perl environment.

    I'm happy to help you if you want to move forward.

  • MrC
    MrC
    Volunteer Moderator

    @bohn007

    As I stepped away from the problem, I thought more about what you're trying to accomplish. If all you need is to do is output, say the title, URL, and perhaps some other fields for all Login items that have a TOTP, I could provide you with a quick script for that. If that works for you, just let me know what fields you want in the CSV the script would create.

    Please recognize that is not possible to output deeply-nested data like JSON to a CSV file. Fortunately, the 1Password JSON isn't very complex, so it isn't too difficult to grab some fields that you need.

  • bohn007
    bohn007
    Community Member
    edited August 2021

    Hey @MrC

    Makes total sense, I can see requests similar to this being made more frequently to me and my team as our business continues to grow. For that reason I can justify (in my mind atleast) spending the time to get the converter running.

    I have just checked and looks like I am already running the latest version of xcode and installed macports 2.7.1 from here: https://github.com/macports/macports-base/releases/

    Let me know what perl modules I need to install.

    If you ever end up writing up that converter let me know and I will gladly be your guinea pig.

    Thanks again for your help with this!

  • MrC
    MrC
    Volunteer Moderator
    edited August 2021

    @bohn007

    Ok, you're already most of the way there.

    Two additional modules you need for the onepif converter are p5-xml-simple and p5-xml-libxslt. These are installed with:

    sudo port install p5-xml-simple  p5-xml-libxslt
    

    This will start the Perl module dependency chain resolution, pulling the default Perl install (Perl 5.28). Say "Y" when it asks you if it's OK to install the dependencies. There will be a several more modules, but I don't bother documenting / remembering which ones - I just install them whenever I re-install MacPorts, run the converter, and get a missing module error. It takes me only a few minutes, so I have no list to provide you.

    What you will see when you try to run the converter are errors about missing modules, and these will have names like Text::CSV which in MacPorts names turns into p5-text-csv. You replace the double colon's with a dash, lower case the names, and prepend "p5". So a missing module Text::CSV turns into needing to do this:

    sudo port install p5-text-csv
    

    Repeat until the converter runs. Be sure you’re using /opt/local/bin/perl, and not the system’s Perl.

    I'm here if this gets too perplexing, and sorry for the hassle.

  • bohn007
    bohn007
    Community Member

    Success! Got it working, no additional ports were needed other than the ones you listed. Thanks for the help!

  • MrC
    MrC
    Volunteer Moderator

    Outstanding, @bohn007 , and you're welcome.

    Let me know if there's anything else I can help with.

  • Thanks for jumping in to help out here @MrC. Stellar assist, as always. ❤️

    Ben

This discussion has been closed.