Migrating from KeePass to 1Password

I’ve been using KeePass for my password management needs since early 2014, but I recently decided that I wanted to move to something a bit more substantial. KeePass is an excellent (open source!) piece of software, but since it stores passwords in a single database file the only way that I could really sync it between multiple computers and my phone was to store that file… in Dropbox.

Yeah, as you can imagine that’s not a great solution.

Anyway, I wanted to move over to 1Password but when I tried searching for “Migrate KeePass to 1Password” I kept seeing references to 3rd party scripts I’d need to use to convert my exported data (no thanks) or that it would require a bunch of manual data entry. After giving it a go though, I can tell you it was actually ridiculously easy and straightforward and didn’t require any external tools or scripts! As such, I decided to put together this step-by-step tutorial for migrating your data from KeePass to 1Password!

Steps

Preparation

  1. Back up your KeePass file

Your passwords are important and whenever you’re doing something like this, first start with a backup! Get a copy of your kdbx file and keep it somewhere safe just in case you run into any problems further in the process.

  1. Clear out old entries that you won’t want later

Now that you have a backup, rather than spending time exporting old entries only to delete them later I definitely recommend cleaning them up in KeePass at this step.

Export from KeePass

  1. Open KeePass and the password file you want to export
  2. Click “File” -> “Export…”
A screenshot of the File menu in KeePass with the "Export" option highlighted
  1. Select “KeePass CSV (1.x) as the format
A screenshot of the Export File/Data window in KeePass with the "KeePass CSV (1.x)" option highlighted
  1. Set “Export to” to the location you want the file saved (use the file selection dialogue by clicking on the floppy disk icon)
  2. Click “OK”

Import into 1Password

  1. Open the the 1Password web interface
    I’m not entirely sure why this can’t be done in the desktop application (which only seems to support importing a 1PIF (1Password Interchange Format) file, an Agile Keychain or an OPVault folder), so make sure you open the website!
  2. Click on your profile name in the top right and select “Import”
A screenshot of the 1Password web interface, with the profile dropdown opened and "Import" selected
  1. Choose “Other”
A screenshot of the import process in the 1Password web interface. The current step has a heading of "Where is your data coming from?", with the "Other" option highlighted
  1. Under “Choose a vault”, select the vault you want to import your data into (in this case, “Test”)
A screenshot of the import process in the 1Password web interface. The current step has a title of "Export your data and add it to 1Password" and there is a dropdown that says "Choose a vault" and a section titled "Upload your CSV file"
  1. Drag and drop the CSV file from the location you chose in step 4 into the window, or use the file selection dialogue
  2. Make sure that the data looks reasonable, like checking that there aren’t multiple elements on one line (if there are, see the section later in this post titled “Fixing Data Import Issues”)
A screenshot of the import process in the 1Password web interface. The current step shows a preview of the data to be imported and has a series of checkboxes down the left side specifying what kind of item they are (in this case, all "Login" items)
  1. Change the top line from “Login” to “Ignore Row” (this is the automatically included header line exported from KeePass that 1Password would otherwise try and import as a separate item)
A screenshot of the import process in the 1Password web interface. The preview of the data import has the top line (with header elements such as "Account" and "Login Name") has been set to "Ignore Row" instead of "Login"
  1. Click “Continue”
  2. Set the labels for each data item. By default my version of KeePass exported the data in the following order, but look at what makes sense for your data:
    1. Title
    2. Username
    3. Password
    4. URL
    5. Notes
A screenshot of the import process in the 1Password web interface. The current step shows a preview of the data to be imported and has the data fields specified for each column
  1. Click “Import”
A screenshot of the import process in the 1Password web interface. The current step has a heading of "Import Successful!" and says "5 items were added to the Test vault. Make sure you delete the unencrypted CSV file."
  1. Click “Show imported items”
A screenshot of the 1Password web interface. The current screen shows the "Test" vault, which has five Login items associated with it

Final Steps

Your data should now be imported! There are a few things that are worth doing before you consider the process complete though:

  1. As the final step in the import process says, this is a good time to permanently delete the unencrypted CSV file that you generated!
  2. Save a final copy of your KeePass kdbx file in a safe location. Although you’ve imported all of your logins into 1Password, you won’t have access to any of the password histories that were stored in KeePass. It’s best to keep a copy available just in the (hopefully unlikely) situation that you need an older password or want to see what changed on that entry over time.
  3. If you had to clean up any of the data in the original CSV file (using the steps in the “Fixing Import Data Issues” section), now is a good time to fix any badly quoted text or escaped quotations. Go through any of the items that you modified and fix the notes!

And now you’re done. Enjoy 1Password!

Fixing Data Import Issues

The CSV export from KeePass escapes quotation marks (converting " to \") and the 1Password import process doesn’t always handle this very nicely.

As an example, I had a note with the following text in one of my logins:

This is an example of a longer comment with more detail. I'm going to keep writing things and show that they are all migrated automatically without issue.

I can even use newlines without a problem since they're persisted across!
"I can use quotes as well since they are correctly escaped"

(Yes, the hubris of writing that and then finding out it didn’t work properly was not lost on me)

In the exported CSV, this generates the following:

"Service1","Username1","Password1","","This is an example of a longer comment with more detail. I'm going to keep writing things and show that they are all migrated automatically without issue.

I can even use newlines without a problem since they're persisted across!
\"I can use quotes as well since they are correctly escaped\""
"Service2","Username2","Password2","",""

I’m not entirely sure why, but it seems that 1Password has issues with the escaped quotes near the end of line 6 and considers the following line (line 7) as additional elements to the same login. You can see the problem a bit clearer in the import data preview:

A screenshot of the import process in the 1Password web interface. The preview of the data to import has one line that extends further than the others because it includes the data of two different logins, one after the other

Thankfully, this can be fixed by removing the final quote on line 6 so that the data looks as follows:

"Service1","Username1","Password1","","This is an example of a longer comment with more detail. I'm going to keep writing things and show that they are all migrated automatically without issue.

I can even use newlines without a problem since they're persisted across!
\"I can use quotes as well since they are correctly escaped\"
"Service2","Username2","Password2","",""

4 thoughts on “Migrating from KeePass to 1Password

  1. I’m trying this as well, the only issue is, that I also use attachments and string fields ( for those Recovery questions ). I have no idea how this translate to 1password, anyone has any advice?

    Like

  2. I am migrating from Lenovo/Windows to Apple, and this is the reason why I am migrating from KeePass to 1Password.

    In my first attempt I followed the instructions above and it did not work. I copied the csv-file from my Windows laptp to the Mac. The csv-File looks different on the Mac and 1Password is not able to import it properly.

    In my second attempt I opend the 1Password webinterface on the Windows laptop and it worked as designed.

    Thank you very much, this saved me a lot of manual work!

    Like

  3. So, how does 1Password compare to the likes of Dashlane Premium? I have used Dashlane for some years but its a pricey solution especially if you want the whole family involved.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.