Export from LastPass to KeePassXC
LastPass changed its subscription plan and different guides popped up to review the best alternatives, as expected. My favorite password manager has been KeePassXC for quite some time. In this guide, I’ll show you how to import LastPass passwords into an existing KeePassXC database so they are all neatly organized in one group.
First, a warning: you’re about to download your passwords in plaintext. Do not save this file anywhere online. If you don’t know what plaintext is or why it is passwords in plaintext are dangerous, please stop and proceed to the nearest exit in calmly fashion. Please remember to get rid of the CSV file as soon as you’re done (and make sure it doesn’t stick around in your trash/recycle bin).
To Export from LastPass, your best option is to use their extension1. Be sure you’re logged in, Click, Go to “Account Options,” then “Advanced,” then “Export,” then “LastPass CSV file”. You’ll be prompted to enter your master password, and then the CSV file should start downloading.
You don’t have to open the CSV file, but if you were to do so (I used LibreOffice Calc), you’ll see that the first line of each column describes what’s under:
- Column A - URL
- Column B - Username
- Column C - Password
- Column D - Extra (the equivalent of “notes” in KeePassXC)
- Column E - Name (“title” in KeePassXC)
- Column F - Grouping (“Group” in KeePassXC)
This order is important when you import to KeePassXC, you’ll soon see why.
Next, start up KeePassXC and open your database. Click “Database” (top left), then import, Then “CSV File”. Point KeePassXC to the LastPass CSV file. KeePassXC goes through few quick setup steps to configure your new database for you. If you’re following my method and want to eventually have your LastPass passwords inside your current database, don’t worry about this part too much; the database you’ll create is only temporary. Those of you who want to keep two separate databases (in two separate files) should probably pay more attention to the encryption settings and where you save the database file.
Once you’re done with importing and save the new database somewhere, KeePassXC will display a window showing you how the columns in your CSV will get imported. Take a moment, as KeePassXC’s order of columns is different than the order it exists in LastPass. If you take a look for a minute and followed up above, what you see should start making sense.
Assuming my LastPass database setup is no different than anyone else’s, the order to sort from LastPass to KeePassXC database is as follows (left side: KeePassXC order, right side: LastPasss’s CSV columns):
- Group: Column 6
- Title: Column 5
- Username: Column 2
- Password: Column 3
- URL: Column 1
- Notes: Column 4
The rest do not exist in KeePassXC, so mark them as “Not Present” from the dropdown menu. Leave the codec as UTF-8. Here’s a picture below (note that I forgot to mark “Not Present” like I implied above) showing you how this looks like after I was done sorting. Note that the first line in the red rectangle mirrors the column heads above it.
When you import the database, it will open a new tab in KeePassXC with the name you gave it. If you intended was to create a separate database, you’re done: you should have an organized KeePassXC database from LastPass in another file. I find it more effective to have all these passwords in one place.
Before you continue merging the new database, please make a backup. Even if you have a daily backup, just make a copy in case something goes wrong and you want to try again.
From the same “Database” menu you used before, find the option to “Merge From Database”. Point to your freshly-made new KeePassXC database and merge it. KeePassXC will throw all the entries in your current database root group; it will be messy. That’s OK, we’re going to put everything in one place next.
Create a new group in KeePassXC (I called mine simply “LastPass”). Then, on the main view of your database, where it shows the different columns, scroll right until you find the “Modified” column and sort by it. This should group all the recently imported passwords to the top (or bottom). Find the first entry you imported, highlight it, then scroll down all the way to the bottom, and shift-click-select all the freshly merged entries. Drag all of them over to the new group you just created and… done. Your new passwords are now in that folder2.
That’s it. You’re now LastPass free and have all your passwords in KeePassXC, in an organized fashion. As you use them, take the time to trim out duplicates, add icons, and slowly take them out of the big “LastPass” folder you created to the appropriate place in your working database.
It’s possible to export your passwords directly from the LastPass vault with the browser, but from my experience, LastPass opens the database to a webpage that cannot be downloaded as a CSV file. When I tried that, I got both errors when I opened the file with LibreOffice’s Calc and when I tried to import to KeePassXC. It’s annoying you need to count on LastPass’s tool to get out your passwords, which is one more good reason to leave. ↩︎
When I was playing around with this later, I realized that the sorting method I described does not work if the LastPass-created database has folders (groups) in it. So, be careful when you import and make sure the new database does not have folders; if it does, just delete and import it again, and mark “Not Present” for groups to see if that solves it. ↩︎