It's an asymmetric world

Coredumps from Jesus Castagnetto's brain

 
  • Increase font size
  • Default font size
  • Decrease font size

Merging KeePassX databases

Print

I've been using KeePassX to keep my passwords safe across the Operating Systems I routinely use (Mac OS X, Ubuntu Linux), or have to deal with (MS Windows XP).

KeePassX has been a time saver since I started using it (about a couple of years ago), and I really like its cross-platform availability and the way you can easily group accounts, apart from feeling safe due to the good encryption (AES, Twofish) algorithms used in the program.

But, I have a problem. Sometimes I will record a new user/password combination in one machine and then forget to do the same on the database I carry on my USB, to propagate that change to the computers I used at work and at home. At the moment, there is no option to merge or import into an existing database in KeePassX (there is a feature request asking for that), so I have to either do it by hand or look for a workaround. Being lazy, I decided to go for the second option.

Fortunately, you can import/export your data to the KeePassX XML format. That, coupled with the XSLT file at Oliver Becker's site (merge.xsl), provided the solution I needed:

  1. Export your datbases to the KeePassX XML format (let's say db1.xml y db2.xml).
  2. Run it through xsltproc:
    $ xsltproc --output merged.xml --stringparam with db2.xml merge.xsl db1.xml
    This will merge the contents of db2.xml into db1.xml and write the output to merged.xml
  3. Import the newly created database, and save it with a new (or old, if you want) filename.

Short and sweet. Not bad for a workaround, and seems to work just fine.

 

Baby's arrival

(aprox.) until the happy event

Random Photo

Green Hosting at Dreamhost.com
Get Ubuntu
Use OpenOffice.org

Visitors map

Anti-Spam Bots!