My KeePass to LastPass Migration Woes!

Preliminary

This blog post details the technical difficulties faced when trying to migrate from using KeePass to LastPass. KeePass has been an excellent password companion for the last 6 years and I’ve been using MiniKeePass for iOS, loading my password safe from Dropbox quite happily. But since starting to use a Chromebook I’ve been increasingly frustrated in this area. There are a few Chrome extensions that provide access to KeePass. CKP has 4.5 stars in the Chrome app store, but I’ve found this browser extension clunky and annoying to say the least. Manual search in CKP doesn’t work properly and despite the good reviews overall the experience in my opinion is poor. Not to mention it only gives read-only access to the password safe.

So I finally bit the bullet and decided to migrate to LastPass, after months of frustration trying to access my password safe from ChromeOS.

Here I document my migration woes, for no other reason than to provide help to anyone who might be googling for this info!

The import

LastPass supports importing from KeePass. You have to export to XML then upload the XML. Sounds simple, but fraught with the following problems.

Tip #1: use Firefox. Don’t question this, just install Firefox and run the import in Firefox. This solves a lot of issues.

Tip #2: if you used folders in KeePass, consider exporting each folder as a separate XML file. If you export the whole database, the result is that *all* your folders will be in a top-level folder. There’s no obvious way to change this later.

Problem: import process hangs

Solution:

  • My KeePass database had a folder structure. As per Tip #2 above, split up your export into different XML files, one per top-level folder. To do this, right click on your folder in KeePass and there’s your option to export
  • The process can still hang, and I scoured the XML file for possible issues, however I learned after much trial and error that the hanging was random and not related to strange characters. Delete the folder that may or may not have been imported into LastPass by right-clicking on the folder in the web interface. Again – don’t attempt this in any other browser than Firefox, results are highly unreliable in Chrome! Then simply re-attempt to import. For me at least, it worked on the second or third try.

Problem: Items are imported as note ITEMS, not website ITEMS

I used KeePass to store credentials for websites, banking, etc., as well as other personal info like driver’s licence info etc.

LastPass stores items as different object types. Anything you import that had something in the URL field in KeePass will be stored into a website item. Anything else will become a “Secure Note” of type “General”.

So if you’re like me and didn’t really bother putting anything in the URL field in some / many / all of your entries in KeePass, you’ll need to do the following.

Screenshots

What you need to do is edit your XML file before importing to give the URL field some value. I gave mine this: http:/0 as if you accidentally attempt to launch the website we don’t want LastPass attempting to send your credentials to a website that actually exists like www.null.com (yes, it exists…)

To do the above, using Sublime Text Editor:

  • Remove leading whitespace from the XML file, otherwise the following step won’t work. Press Ctrl-H to find and replace, click the Regex button, and use this string ^[^\S\r\n]+ and make sure nothing is typed into the replace box. Replace all to remove leading spaces / tabs
  • You now want to find and replace all instances of the URL field where it’s blank, but not where it’s not. Find multiline string

<Key>URL</Key>
<Value />

with

<Key>URL</Key>
<Value>http://0</Value>

Use Ctrl-Enter to split the lines in the find and replace fields.

Now hit Replace, save the file, and try the import. This time you should notice the icon next to all items is not the purple pen (secure note), but the white box (website).

Tags: ,

10 comments

  1. Huge thanks for the fix for importing items as notes. That was a large roadblock to successful migration!

  2. Great article! Thank you. I was very close to abandoning the move to LastPass.

  3. As with Dan, thanks for the extremely helpful tips to avoid an import as a note!

  4. This was really helpful – thanks!

  5. Thank you so much!

  6. Just another thank-you for posting this info!

  7. Thanks for doing this investigation, and for posting about it.

    Is this still the state of the art?

  8. Just googled my problem and found here a solution.
    Thank you random blogger that solved yet another problem of mine 😉

  9. Thanks a lot for the URL tip! It was driving me crazy!
    Cheers!

  10. Awesome! Thanks for that! Well done

Leave a Reply

Your email address will not be published. Required fields are marked *