KeePassium icon indicating copy to clipboard operation
KeePassium copied to clipboard

Export to CSV format

Open moenodedev opened this issue 3 years ago • 8 comments

Support export to CSV since it's unlikely Firefox will support MacOS AutoFill soon and it doesn't like a KeePassium addon for Firefox is on the roadmap. Also, Safari Auto Fill is broken when Touch ID is enabled (#259). Adding CSV export would make it easier for desktop users to use autofill functionality built into browsers.

Safari

Safari CSV import format

Fields

  • Title
  • URL
  • Username
  • Password
  • Notes
  • OTPAuth

Example CSV

Title,URL,Username,Password,Notes,OTPAuth
"Apple","https://apple.com","[email protected]","password","","0000000000"

Safari also supports the Firefox CSV format.

Firefox

Limitations of about:logins

  • Does not have a Notes field
  • Does not allow extra fields
  • Does not support TOTP or two factor tokens

Firefox about:logins CSV import format

Fields

  • url
  • username
  • password
  • httpRealm
  • formActionOrigin
  • guid
  • timeCreated
  • timeLastUsed
  • timePasswordChanged

url, username, and password values must be present (not blank "" or null) otherwise the row will not be imported.

Example CSV

"url","username","password","httpRealm","formActionOrigin","guid","timeCreated","timeLastUsed","timePasswordChanged"
"https://apple.com/","[email protected]","password","Apple","","00000000-0000-0000-0000-000000000001","","",""
url username password httpRealm formActionOrigin guid timeCreated timeLastUsed timePasswordChanged
https://apple.com/ [email protected] password Apple 00000000-0000-0000-0000-000000000001

The columns can be in any order and they will be matched.

Importing the CSV into Firefox

Enable CSV import in Firefox

  1. Open about:config
  2. Set security.allow_eval_in_parent_process to true
  3. Set signon.management.page.fileImport.enabled to true
  4. Set those options back to false after importing the CSV

Import the CSV

  1. Open about:logins
  2. Click the dropdown button in the top right corner
  3. Click Import from a File...
  4. Select the CSV file and click the Import button
  5. Review the import summary at about:loginsimportreport

Any existing entries will be updated.

Documentation

moenodedev avatar Oct 28 '22 11:10 moenodedev

Safari on MacOS will also import logins in this CSV format. If the two factor token value is included in an OTPAuth column the "Verification Code" will be imported.

Safari exports these fields to CSV: Title,URL,Username,Password,Notes,OTPAuth

https://support.apple.com/en-in/guide/safari/ibrw1015/mac

moenodedev avatar Oct 28 '22 11:10 moenodedev

Thank you for the detailed description.

I would generalize this as "CSV export from the Mac version", with specific format variations for Firefox and Safari. This would be redundant for the mobile app, but totally makes sense for the desktop version.

keepassium avatar Oct 29 '22 10:10 keepassium

This functionality may be better as a separate program specifically for converting kdbx to csv because that would allow you to perform the export in a script or an xbar command or a MacOS shortcut.

moenodedev avatar Oct 31 '22 05:10 moenodedev

@moenodedev , there is already keepassxc-cli export for that :)

keepassium avatar Oct 31 '22 09:10 keepassium

On desktop I already have KeeWeb since it has a clean and intuitive UI. I see that it has XML and HTML export. I don't want to install a mess of apps so I decided to resubscribe to 1Password for now. I hope #259 can be resolved soon and that MacOS Auto Fill will be implemented in Firefox eventually.

moenodedev avatar Oct 31 '22 15:10 moenodedev

In the wide perspective, CSV export still makes sense for desktop KeePassium, so I will reopen this to keep it on the list.

keepassium avatar Nov 01 '22 10:11 keepassium

Hello, would someone please explain what the column "guid" means when exporting passwords from Firefox? Is it relevant for the import? Thank you in advance!

FreedomIsAChoice avatar Jan 31 '24 09:01 FreedomIsAChoice

@FreedomIsAChoice , KeePassium does not import/export data from/to other formats. You will get a more informed answer from Firefox team and that of the importing app.

keepassium avatar Jan 31 '24 10:01 keepassium