I recently skimmed a paper showing the success of attacking the security of various password database file formats. The only one which withstood both the passive and active attacks was the Password Safe format.
I wondered how hard it would be to migrate my KeePass data into a Password Safe DB. The Googs showed lots of results for moving from Password Safe to KeePass but not the other way around. Here’s what I finally used to import into Password Gorilla (warning: Password Gorilla by default on my Mac created a v1 database file, which was unreadable by other password safe-compatible apps). When I created an empty v2 file and then opened it with Password Gorilla, I was then able to ask it to import the CSV successfully.
cat keepass.csv | perl -pe 's#\n#\\n#gm' | \
perl -pe 's#\\n($|Root/)#\n#g' | \
perl -pe 's#Group,Title,Username,Password,URL,Notes#group,title,user,password,url,notes#' \
Don’t forget to
shred your intermediate csv or other files when done.