Going from Revelation to KeePassX
By Louis-Dominique. Filed in Software |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.



Wednesday, March 25th 2009 at 7:42 am |
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.
Wednesday, March 25th 2009 at 7:56 am |
You can sure use my script if you want to produce something more sophisticated in python. Usual caveats: it is throwaway code so not very robust and it was designed to cater to my needs.
Wednesday, April 29th 2009 at 8:48 am |
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’
Wednesday, April 29th 2009 at 3:35 pm |
This is not surprising. Here is the key passage from my original post:
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.
Friday, September 25th 2009 at 3:46 pm |
Thank you for your script. i’d just adjusted it for my needs and it worked fine.
Saturday, September 26th 2009 at 11:32 am |
Thanks for the report. I’m glad it was helpful.
Thursday, January 14th 2010 at 2:15 pm |
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.
Sunday, February 14th 2010 at 8:07 pm |
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
Monday, December 6th 2010 at 10:19 am |
Oops. It seems I forgot to comment. Let me fix this omission:
Thank you, Oleg, for sharing your changes.
Tuesday, November 30th 2010 at 3:41 pm |
added some support for Databases.
http://pastebin.com/mR2RnwsS
Monday, December 6th 2010 at 10:20 am |
Thank your for sharing, jendrek.
Thursday, December 22nd 2011 at 6:59 pm |
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.
Thursday, December 22nd 2011 at 7:24 pm |
Andrew, thanks for the feedback. I’m glad people are still finding the script useful.