Going from Revelation to KeePassX

By Louis-Dominique. Filed in Software  |   
TOP del.icio.us digg

I’ve decided to ditch revelation. I’ve used it for several years to manage my passwords but development seems to have stalled. The author’s website is currently inaccessible. So it is over for me. Read on for the method I used to convert my database of passwords.

I’ve switched to KeePassX because it seems better supported and has the features I want. Wzzrd produced a script to perform the conversion. His script is in Ruby, a language I’m not particularly interested in. Moreover, his script did not quite do what I wanted so I converted his script to python and adapted it to my needs. I’m attaching the script to this post: revelation-to-keepassx Anybody wanting to use this script should be warned that it is throwaway code and that I implemented just as much as I needed.

The way I converted my data was:

1. Export the data from revelation into an unencrypted XML file. (It is advisable to export it to a file in volatile memory like /dev/shm. This minimizes the risk of leaving unencrypted data in free blocks after the conversion is done.)

2. I ran my script without options:

$ revelation-to-keepassx /dev/shm/revelation-export.xml > /dev/shm/keepassx.xml

(Note that I save the result in /dev/shm again.)

This resulted in the output:

revelation-to-keepassx: ERROR: stripped following ids: generic-keyfile, generic-location, generic-certificate, creditcard-cardtype

I checked my input file to verify that I would not lose anything important if <field> elements with the above ids were to be stripped from the output instead of converted.

3. I reran the script as above but with the “-i” option which tells the script to ignore the stripped ids.

4. I imported the resulting file into KeePassX.

I’ve inspected the final database and found no evident problem. To be on the safe side I used gpg to encrypt the XML file I exported from revelation so that even if I eventually run into trouble and revelation is not easily installable, I can visually inspect the XML file.

13 Comments

  1. Comment by Maxim:

    Interesting. I switched my main scripting / programming to Python (for professional reasons) a couple months ago. I had planned to rewrite the script in Python if I had some time, but you beat me to it. Maybe I’ll take a look sometime and see if I can expand on it a bit.

  2. Comment by trunc:

    I found this error

    python revelation-to-keepassx.py revel.xml > keepass.xml -i
    Traceback (most recent call last):
    File “revelation-to-keepassx.py”, line 124, in
    parse_folder(old_root, new_root, 0)
    File “revelation-to-keepassx.py”, line 62, in parse_folder
    parse_folder(item, element, group_depth + 1)
    File “revelation-to-keepassx.py”, line 73, in parse_folder
    ElementTree.SubElement(element, “icon”).text = str(from_type_to_icon[item.get("type")])
    KeyError: ‘ftp’

    • Comment by Louis-Dominique:

      This is not surprising. Here is the key passage from my original post:

      Anybody wanting to use this script should be warned that it is throwaway code and that I implemented just as much as I needed.

      I did not need to support the “ftp” type so I did not implement conversion for it. I encourage you to modify the code to suit your needs.

  3. Comment by can3p:

    Thank you for your script. i’d just adjusted it for my needs and it worked fine.

  4. Comment by Ashley:

    Just ran across this: Need to convert to Keepass so I can use jbiKeePass on iPhone. Worked a treat even though I’ve never had to hack a python script before. Many thanks for the script.

  5. Comment by Oleg:

    Sadly in my case script worked pretty much worse han expected, so I hacked it further and:
    — It knows about “Shell”, “FTP” and “email” fields
    — It gracefully skips unfilled “Expiry date” and some other fields
    — It supports some more FTP / Shell / email / Credit card specific fields.

    Anyway, “I implemented just as much as I needed” too :) .

    So if the original author’s script fails and you know little about programming, try it:

    http://pastebin.com/f221151ff

    P/S to the author: thank you for a nice piece of Python. I bet some day I’ll learn it

  6. Comment by jendrek:

    added some support for Databases.
    http://pastebin.com/mR2RnwsS

  7. Comment by andrewm:

    Hi, I just wanted to say that I came across your script and have successfully converted my revelation password database. Many thanks for taking the time to write this, and also to the other contributors.

  1. Ping from Миграция с revelation на KeePassX : Дмитрий Петров

Leave a Reply