Category Archives: lastpass

How to Export Passwords from Lastpass to KeeWeb or KeePass

I recently became interested in switching away from Lastpass , a password manager that is very convenient, but has some drawbacks for me, for several reasons.

My Requirements

I wanted a password manager that would allow me to:

  • use iOS as well as my desktop PC
  • Utilise an open source project
  • Control where the file containing the list of passwords was stored.

With KeeWeb, you can store locally or in cloud storage like Dropbox or google Drive.

The Challenge

Unfortunately, getting your account names, usernames and passwords out of Lastpass and into KeeWeb is a somewhat complicated process. This guide helps you through this process, step by step.

The Solution

The process involves: exporting the data from Lastpass, cleansing the data in Excel, importing the clean data into KeePass (a free windows password utility), saving the data in a format that KeeWeb recognises, and finally importing the data into KeeWeb.

Step by Step: Cleaning the exported Lastpass data and importing to KeeWeb

According to this help file [http://keepass.info/help/base/importexport.html#csv], your information must be in this format:

“Account”,”Login Name”,”Password”,”Web Site”,”Comments”

  1. Go into lastpass vault, select export, enter password. Ctrl-A, Ctrl-C and save as lastpass.txt.
  2. Open Excel. Data tab, From text, select the new text file you just created. Separate by commas, you should see the data split neatly into columns.
  3. Next step is to clean the data. Rename Sheet1 excel tab to “Original Export” and rename Sheet2 to “Clean Export”. We will use Sheet2 to create clean data that KeePass (the utility we use as an intermediate step) will recognise.
  4. Hide all columns except the “url” column
  5. In the cell next to the “url” cell, type in “Valid HTML?” (in my case, cell number H1) and enter this forumla in the cell below it: =(IF(LEFT(A2,4)=”http”,”Y”,”N”)) Drag this formula down the list of URLs, until you come to a point in the spreadsheet where none of the cells in the URL column start with “http” (this is the export of your Lastpass secure notes). With the list of cells still selected, go to the white box on the top left (to the left of the formula bar) where it states the current cell/range, double click it, and type “validTest”. This will quickly allow us to reference this range. This forumla will detect the cells where the value starts of doesn’t start with “http”. This allows us to quickly find the cells where the exported data is in a format that KeePass won’t recognise.
  6. In the cell next to “Valid Html?” type “Non valid count:” (Cell I1 in my case) and in the cell next to that, type “=COUNTIF(validTest,”N”)”. this quickly counts the number of non-valid urls from our overall list.
  7. With the list of cells still highlighted, go to Home tab> Conditional Formatting > Highlight Cell Rules > Equal To > type in “N” (with quotes) and for formatting select “Light Red Fill with Dark Red Text”. This highlights all the broken links in red for us.
  8. On the numbered left column, click row 1, to highlight all the cells. Select Data tab > Filter.
  9. In the column headed by “Valid HTML”, click the dropdown arrow and select only the “Y” checkbox, click OK.
  10. Unhide all the columns
  11. In the “Cleaned Export” sheet, name cells A1-E1 “Account”,”Login Name”,”Password”,”Web Site”,”Comments” respectively.
  12. The order of the columns is different in Lastpass to what KeePass expects. This is the order in Lastpass exported file: url, username, password, extra, name. In case it’s not clear Account=name, Login Name=username, Password=password, Web Site =url, comments=extra. Copy all the (filtered and valid) data from the original sheet to the cleaned sheet. Make sure that you don’t change the order of the rows. Make sure to sort the data into the correct column!
  13. Now Ctrl-A and Ctrl-C all the clean data in the sheet. Open notepad, paste in the text. File> Save As> “lastpass_clean1.csv”. In the file type, select all files.

To be continued…