Skip directly to content

1password to keepassX convertor import / export

on March 27th, 2010 at 11:16:46 AM

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!

 

Comments

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.

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

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

Dustin Williams's picture

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

Alan Feathe's picture

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

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!

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

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

Sunny's picture

I use Walletx. This is the best thing in market. 

* Simple and Fast UI.

* Available on all platforms. 

* Free desktop version. http://www.sinew.in/products/walletx/desktop/

Devloper says this month I will definitely get the Sync version.

 

Most loved the desktop version.  try it guys.

philleb's picture

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

philleb's picture

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

Post new comment

Addthis