Username data field is skipped when importing data from Proton Pass

I tried importing data from Proton Pass to Bitwarden using Bitwarden Web vault.
However, its behavior is not quite right, specifically if:

  1. Username and email data both exist: Using email data as username field value, username data is ignored.
  2. Only one of username or email data exists: It will be imported into username field (works correctly).
  3. Neither data exists: It will be ignored.

In the first case, it can be handled more “smartly” by creating a custom text field with the name Username, the value is the username data.

Or it is possible to use the username data for the Username field and create a custom text field with the name Email, the value is the email address.

This will help preserve the data when migrating from Proton Pass to Bitwarden.

@tanquang Welcome to the forum!

Please confirm that you are not self-hosted. Please also confirm that your ProtonPass export is a JSON file (not CSV).

As of the most recent revision to username/email import functionality in the ProtonPass JSON importer (PR 10471, from 9 Aug 2024), if the PP itemUsername is not empty, the the username is always imported into the Bitwarden username field. Thus, if the PP item has both a username and an email, then the username will be imported into Bitwarden’s username field.

When both username and email are present in the PP item, then the Bitwarden PP importer will create a custom field for the email.

So I’m not sure why your experience doesn’t match the expected behavior of the code (unless ProtonPass has made significant changes to their JSON export format in the past 3 months).

Yes, as mentioned above, I am importing data on Bitwarden Web vault, not self-hosted. The data file when importing is JSON format (.zip file) exported from Proton Pass.

When both username and email are present in the PP item, then the Bitwarden PP importer will create a custom field for the email.

I just tried again, deleted all records in the current vault, then went into Proton Pass and exported the data again, then tried importing again on Bitwarden Web vault. This time, it worked exactly as you said. That’s weird!

Is there a way that when creating a custom field email during import, it will capitalize the first letter to Email?

And it’s ignoring Proton’s alias type. Here’s what the alias type looks like when exported in JSON format:

{
  "itemId": "<ITEM_ID>",
  "shareId": "<SHARE_ID>",
  "data": {
	"metadata": {
	  "name": "<ALIAS_NAME>",
	  "note": "<ALIAS_NOTE>",
	  "itemUuid": "<ITEM_ID>"
	},
	"extraFields": [],
	"type": "alias",
	"content": {}
  },
  "state": 1,
  "aliasEmail": "<ALIAS_EMAIL>",
  "contentFormatVersion": 5,
  "createTime": XXXXXXXXXX,
  "modifyTime": XXXXXXXXXX,
  "pinned": false
}

I know Bitwarden doesn’t officially provide an alias email service yet, but instead of ignoring it, Bitwarden could definitely handle this type of data as a Note:

  • Name is the value of <ALIAS_NAME>.
  • Note is the value of <ALIAS_NOTE>.
  • Then create a custom field Alias ​​email (or Email depending on your preference), the value of <ALIAS_EMAIL>.

This would be very useful.

No, this is not possible, as the custom field name email is hardcoded in the PP importer source code.

A work-around would be to export the Bitwarden vault in an unencrypted JSON format, use a text editor to replace every instance of

          "name": "email",

with

          "name": "Email",

then purge your Bitwarden vault and subsequently import the modified JSON file — specifying “Bitwarden (json)” as the import file format.

 

I would suggest going back to ProtonPass and creating a new export in CSV format. Then manually edit the CSV to remove all rows except for the alias items, and subsequently condition the CSV data to match the expectations for the “Bitwarden (csv)” import format. If you need assistance with the conditioning process, I would be happy to help.

 

You could make a new feature request for this, or I could modify the title of your current feature request topic to reflect your new proposal. Please let me know if you wish to keep the current feature request thread open, with an updated title (if not, I will move it to the Ask the Community section of the forum).

This is really not recommended, at least even if it is hardcoded it should be capitalized first letter to make it easier to recognize it as the name/value of a field, lower case like that will easily be mistaken for item/field type.

I appreciate your help, but this is generally a pain.

If possible, I hope you can submit a pull request that modifies the PP importer source code:

  1. Change the custom field name from email to Email as I explained the reason above.
  2. Add PP’s handling of alias type as in my reply #4.

This should solve this problem once and for all.

FYI, I am just a Bitwarden customer, not a developer. If you wish to submit a code contribution yourself, further information about how to get started is available here:

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.