Can't import a 300+ items .1pif. Get "0 items imported" dialog box.

ariellaariella
edited April 2015 in 1Password 4 for Windows

Hi guys. I want to get to a 2009 Mac .1pif export of mine using the latest version of 1Password for Windows. When I choose File-> import and choose the .1pif file, I get a prompt asking if I should import items with a name of "", and then I click on "yes to all". Then the next dialog box I see is "0 items imported". I cannot get 1P Windows to import anything from the file. There are 300+ items in that file and I can see them with a text editor, but I can't figure out why the app won't parse the file.

Is there a backwards compatibility issue with .1pif files? Is there possibly a Mac->Windows file encoding issue I need to convert or something first?

Comments

  • MrCMrC Community Moderator

    Hi @ariella,

    I don't have any idea about the compatibility issues of 1PIF from that far back, but here are some things to try / consider:

    1. Be sure you are running the latest 1Password for Windows beta (several import bugs have been fixed).
    2. Be sure the file is a UTF-8 file - this may mean opening the file with Notepad, and saving it as UTF-8. Use a copy of the file.
  • Good ideas! I'll look for the beta to download it. I'll get the encoding updated in Notepad++ and will let you know how it goes! Thanks MrC!

  • MrCMrC Community Moderator
    edited April 2015

    @ariella,

    You're welcome. FYI: In 1Password's Preferences, go to Updates and select Include Beta versions.

  • ariellaariella
    edited April 2015

    Here's the results using the latest beta:

    -Encode file to UTF-8 (BOM unspecified) using emacs : same issue. During an attempted import, it asks for each item:
    Would you like to import an item named ""?
    I can then say [Yes], [No], [No to All], or [Yes to All]. Doesn't matter what I choose, that item fails to import.

    -Encode file to UTF-8 with and without BOM using Notepad++ : same as above.

    I made two copies of the original .1pif file to do the testing.

    The empty names for items makes me think that there are different keys used in the JSON strings today that aren't present in the old file, thus the 'item named ""' errors. Any developers around? =D

    Here's a sample software license typed item from the .1pif (with some info obfuscated):

    {
    "keyID":"D7...obfuscated",
    "locationKey" : "",
    "secureContents" : {
    "reg_code":"MV...license_number...obfuscated"},
    "contentsHash" : "be...hash..obfuscated",
    "typeName" : "wallet.computer.License",
    "location" : "",
    "uuid" : "064...obfuscated",
    "updatedAt" : 1237299757,
    "createdAt" : 1237299757,
    "title" : "Toast 8",
    "securityLevel" : "SL3"}
    5642bee8-...some number...obfuscated

  • MrCMrC Community Moderator
    edited April 2015

    A 1Password for Windows generated 1PIF does contain a BOM (UTF-8 typically does not):

    $ hexdump -C ~/Desktop/software.1pif
    00000000 ef bb bf 7b 22 6b 65 79 49 44 22 3a 22 37 31 43 |...{"keyID":"71C|
    00000010 46 34 37 36 38 30 42 32 31 34 31 44 38 41 42 31 |F47680B2141D8AB1

    but it doesn't matter if the BOM exists - it will import either way (it could have been generated on OS X, which doesn't include the BOM).

    End-of-line markers don't matter (all of Unix, Mac, and Windows work).

    Here is a sample software.1pif which you can use as a reference. Some of the items are not required, some will be generated on import (e.g. keyID, locationKey, contentsHash, securityLevel, createdAt, udpatedAt, uuid)

    {"keyID":"71CF47680B2141D8AB15ED558EE548BC","locationKey":"","typeName":"wallet.computer.License","location":"","uuid":"63A8291F889243E5BD8F2CEEA99DDE4C","updatedAt":1430074634,"createdAt":1430074634,"title":"Note: Software License","contentsHash":"ff5a1935","securityLevel":"SL5","openContents":{"tags":["Secure Notes"]},"secureContents":{"order_number":"1234","retail_price":"22.00","publisher_website":"www.example.com","support_email":"[email protected]","product_version":"2.0","reg_code":"1234567ABC","publisher_name":"AnySoft","notesPlain":"Notes:watch for stupid Feb 31 date input\n\n\nPurchase Date: February,31,2014","nlicenses":"2","sections":[{"fields":[{"n":"product_version","k":"string","v":"2.0","t":"version"},{"n":"reg_code","a":{"multiline":"yes","guarded":"yes"},"k":"string","v":"1234567ABC","t":"license key"}],"name":"","title":""},{"fields":[{"n":"publisher_name","k":"string","v":"AnySoft","t":"publisher"},{"n":"publisher_website","k":"URL","v":"www.example.com","t":"website"},{"n":"retail_price","k":"string","v":"22.00","t":"retail price"},{"n":"support_email","k":"email","v":"[email protected]","t":"support email"}],"name":"publisher","title":"Publisher"},{"fields":[{"n":"order_number","k":"string","v":"1234","t":"order number"},{"n":"order_total","k":"string","v":"$44.00","t":"order total"},{"n":"nlicenses","k":"string","v":"2","t":"number of licenses"}],"name":"order","title":"Order"}],"order_total":"$44.00"}}

  • Hi @ariella,

    MrC is pretty much the expert when it comes to .1pif files but I was wondering if you remember what version of 1Password for Mac this .1pif would have come from. If you remember we can try performing some tests with the demo vault and see if we can replicate the situation. If we can maybe we can understand how it is broken and a potential fix.

  • MrC, the key order in your entry is different than mine. Must be differences in versions.

    littlebobbytables: I believe I had version 2 of the software since I did the export in August 2009, before version 3.0.0 was released in November of that same year:
    https://app-updates.agilebits.com/product_history/OPM3 .

  • I have a PowerMac G4 with OS X 10.4.11 I can try using along with a V2 of 1Password to try importing the .1pif into. Anybody have a download link for that old version? :) I looked here, but it's missing: https://agilebits.com/downloads

  • MrCMrC Community Moderator

    Are you using AgileKeychain vaults, or the new OPVault ?

    The key order doesn't matter, btw.

    You can try narrowing the issue perhaps. On a copy, remove all but a single entry and see if that can import. If it does, add more entries using a divide and conquer approach. If it does not, start by removing some key/value pairs from the optional attributes I mention above. This is how I went about reverse engineering the 1PIF format to learn how 1Password treated the items in the 1PIF.

  • I went digging in the blog and found a download link for V2, but it no longer exists. :)

    https://blog.agilebits.com/2009/08/ points to http://agile.ws/downloads .

  • MrCMrC Community Moderator

    I went looking too - neither is it on the Internet Archive.

  • RESOLVED! I found a torrent of V2.5 and was able to import the .1pif file on my Powermac G4! Yay! I then looked up my license for V2 after the import was done, and activated the app with it. :)

    I'm ok now phew! I'll backup the library and the data folder and see if I can get that working in the V4 of the app on Windows. If not, I don't mind fishing for things on the old Mac.

    Thanks so much for the help!

  • I can't import the .keychain file from the V2 Mac app into the V4 Windows app. The app seems to only work with .agilekeychain files.

  • Tried to make a .csv export from the Mac version, and import it into the Windows version. The Mac version can't export software licenses, only logins, and the CSV import function of V4 Windows only prompted for field assignments on logins. So that's a no-go.

  • I'll stop here. I have the .txt export of V2 Mac on the Windows machine, so I can just file search for licenses and import them manually or whatever. :)

  • MrCMrC Community Moderator
    edited April 2015

    @ariella,

    Forget the CSV format, and the vault backup / re-import cross-platform routes. These are dead ends.

    Does the 1P5 Mac version read in the 2.x 1PIF?

    If you can provide me with a sample 1PIF from the 2.x version, I'll try to see what the problem might be. Create a few entries, of different categories, perhaps Login, Software License, Secure Note, and Credit Card. Use sample data, of course.

  • My Macs are all too old to run V5 of 1P. The youngest is a '99 Powermac G4 with 10.4.11. :) My main machine is a Windows laptop with Windows 8.1.

    I'll see about creating a smaller 1PIF from the V2 app on the G4.

  • Here's the 1PIF from the V2 Mac app with sample data. It fails to import in V4 beta Windows just as before.

    Link: 1drv.ms/1J1ZLtb

  • Here's the 1PIF from the V2 Mac app with sample data. It fails to import in V4 beta Windows just as before.

    Link: 1drv.ms/1J1ZLtb

  • MrCMrC Community Moderator
    edited April 2015

    Hi @ariella,

    Great, that was perfect.

    It appears 1Password 4 for Windows does not ignore the newlines within a record, nor allow spaces surrounding the colon attribute:value pair. So, this single-line entry will work:

    {"updatedAt":1430093576,"title":"Software License 1","location":"","securityLevel":"SL5","secureContents":{"product_version":"2","reg_code":"abcd-efgh-ijkl","product_name":"test"},"locationKey":"","openContents":{ "updatedAt":1430093576,"createdAt":1430093576},"typeName":"wallet.computer.License","uuid":"0FF535B2A120493CAD96360F5FD6F8DF","createdAt":1430093576

    but the V2 version does not:

    {
    "updatedAt":1430093576,
     "title" : "Software License 1",
     "location" : "",
     "securityLevel" : "SL5",
     "secureContents" : {
        "product_version":"2",
         "reg_code" : "abcd-efgh-ijkl",
         "product_name" : "test"},
     "locationKey" : "",
     "openContents" : {
        "updatedAt":1430093576,
         "createdAt" : 1430093576},
     "typeName" : "wallet.computer.License",
     "uuid" : "0FF535B2A120493CAD96360F5FD6F8DF",
     "createdAt" : 1430093576}
    

    It does import on 1Password for Mac v5.

    I can write you a quick converter program if you'd like it.

    @svondutch - if the 1Password for Windows 1PIF parse could accept whitespace more liberally within a JSON stuct, 1Password for Mac V2 1PIFs would import. In particular, this would be whitespace after { and before }, and after commas that follow field:value pairs, and before and after the colon field:value separator.

  • MrCMrC Community Moderator
    edited April 2015

    It was easy enough to construct the converter, so here it is:

    https://www.dropbox.com/s/9gvdxyhxp3s9xy5/1P2conv.zip?dl=0
    

    Download the zip file, and unzip it, placing the 1P2conv.pl script on your Desktop. Using Terminal, run the Perl script against your V2 1PIF as follows:

    cd ~/Desktop
    perl 1P2conv.pl /path/to/your/V2.1pif > converted.1pif
    

    Now, import the file named converted.1pif on your Desktop into 1Password for Windows.

    If you don't know how to figure out the name of /path/to/your/V2.1pif file, just drag that file into Terminal after you've type the first part of the command perl 1P2conv.pl, and Terminal will complete the path name for you. Then just complete the remainder of the command.

    The converter simply reads each of the records delineated by the special marker, decodes the JSON object, and re-encodes it as non-pretty printed UTF8, and outputs the record and the record-separator marker.

This discussion has been closed.