1password to keepassX convertor import / export

I use 1password on my mac.  It's absurdly overpriced for what it is, but it saves me so much hassle, I bought it anyway.

KeepassX is another great password manager which is FOSS and cross platform.  It doesn't integrate nicely with my browser though, so 1password won.

Anyway, I've got linux boxes too, and I wanted to transfer my 1password passwords over to them.  There is no way to do this really, so here's what I hacked up without writing any code (which I hate doing for something so silly).

I posted a 10 step process to do this a few days ago, but decided to dedicate the hour it would take to write a proper script for it.
Tada:

http://github.com/jacobSingh/1pass2keepassx

To use:

  1. Export a CSV file from 1password.
  2. Save this: http://github.com/jacobSingh/1pass2keepassx/raw/master/1pass2keepass.rb
  3. chmod +x 1pass2keepass.rb (might need to do this)
  4. 1pass2keepass.rb 1passexport.csv > /tmp/keepass.xml
  5. Import /tmp/keepass.xml from File -> Import From in keepass

Happy converting!

 

Tags: 

Comments

Quotes

Chad Skeeters's picture

This is very useful. The Ruby CSV (tab) parser and the 1password exporter don't 100% match. A password with a double quote will not be output in the "text""text" format and the program will error out. Thankfully it's not that hard to just change those passwords so there are no double quotes.

Pretty Formatting

Chad Skeeters's picture

I also changed the last line to doc.write($stdout,-1) so that there will be no pretty formatting. This prevents extra spaces when importing the data into keepassX

Hey Chad,   Thanks for your

Jacob Singh's picture

Hey Chad,

 

Thanks for your comment.  Apologies for not responding sooner, had a bit of a spam problem before I got Mollom on my site.  I actually switch to lastpass recently which is even better.  I recommend you check it out.

 

Best,

Jacob

I'm having issues with this

I'm having issues with this script. I have 1password-3.3.0.BETA-3 (Build 30677) on my mac; KeePassX 0.4.3 on Fedora 13.

This is the error I receive after running ./1pass2keepass.rb ~/Desktop/1pass.csv > ~/Desktop/keepass.xml:

ERROR: CSV::IllegalFormatError
Usage: 1pass2keepass.rb 1pass.csv

Takes a _TAB_ delimeted csv file from 1password and prints XML suitable for import into keepassX

Didn't work

Alan Feathe's picture

I got the same error message as Dustin. Sadly this script no longer appears to work :-(.

Still works

Martin's picture

This script does still work. The 1password export is a little confusing, you need to export as "Tab-Delimited Text" rather than "Comma-Delimited Text".

 

In addition to changing the doc.write line (as above), I changed the line:

entryNode.add_element('url').text = row['URL/Location']

to:

entryNode.add_element('url').text = row['url']

so that the login url's are also imported into KeePassX

 

Thanks!

The script is not working for me.

philleb's picture

I get this ERROR-Message:
$ cat /tmp/pass.xml
ERROR: can't convert String into Integer
Usage: 1pass2keepass.rb 1pass.csv

Takes a _TAB_ delimeted csv file from 1password and prints XML suitable for import into keepassX
I tryed it with Debian(worked on Debian) and now on Ubuntu and it does not work anymore :(.
Ruby 1.9.1

How to fix the "bug"

philleb's picture

Hey, it seems that the code that was written by Jacob was written for an older version of ruby(1.8). To get the script work on your machine enter

sudo apt-get install ruby1.8

and then run the script with

ruby1.8 1pass2keepass.rb 1pass.csv > key.xml

Greets

Since when is "all Plattforms

philleb's picture

Since when is "all Plattforms" Mac and Windows only?

Since when is "all Plattforms

philleb's picture

Since when is "all Plattforms" Mac and Windows only?

News

Sree's picture

In many cases, those relatives may not be around or will be unable to take care of those children. In those cases, it is up to the country to care for the child, with or without the help of the international community. That can put a further strain on cash-strapped countries. Thanks for sharing information. Regards, write my essay czech-republic

It is very important to

chrisjames's picture

It is very important to remember your password otherwise you may faces some type of difficulty. cfa level i