Entries quadrupled on import... where is the import code?

My passwords get quadrupled on import. This happens in at least two situations from the web vault:

  • import from lastpass
  • export to bitwarden json → run a personal script to dedup the json → clear vault → re-import

Thought I’d get a code pointer before making an issue, since I don’t even know if the import code is in bitwarden/server (would be my guess) to be sure I’m making an issue in the right repo.

Hi @DustinWehr and welcome to the community.

This is expected behaviour, if you are not purging your vault before re-importing.

Please have a look at our Import & Export FAQs and also our guide on importing into an individual vault.

The Github contributions category is meant for people looking to contribute to the codebase. If you have general questions please use the Ask the Bitwarden community category.

Kind regards,

I purged before importing.

I would check the file that Lastpass creates. The duplicates get created there, I believe - this issue has come up before with other users.

No. As I said:

My script reduced the number of entries from 2004 to 672. Not all entries are quadrupled.

My script only counts two bitwarden json entries as duplicates if they are identical except for the “id” field.

But did you check your Lastpass-generated file for duplicates? That’s what I meant.

To answer your question where you can find the code:

The code for our importers live in the libs directory of our client repository

The code for the Bitwarden json import can be found here: clients/bitwardenJsonImporter.ts at master · bitwarden/clients · GitHub

Tests can be found here

I’d also double check if your vaults (Individual, possibly also Organizational) are properly purged, before you start the re-import.

1 Like

I understood. I no longer have the lastpass csv that I used to import. I just tried exporting from lastpass again, and didn’t see duplicates in the csv. Unfortunately, importing that csv did not reproduce the bad BitWarden vault, with the duplicates, that I had before. It’s possible there’s a nondeterministic lastpass bug that duplicates on export, but that would imply I also encountered something like buggy BitWarden UI or sync behavior when I performed this sequence of actions (elaborated description from original post) earlier today:

export to bitwarden json → run a personal script to dedup the json → purge vault → refresh web vault page, which causes another master password prompt → see apparently-empty vault with “There are no items to list” message, which I took as verification that the purge was successful → import deduped json file → refresh web vault page again, same as before → see vault with many entries quadrupled.

If I manage to reproduce, I’ll open an issue. Thanks for the pointer @djsmith85; I’m convinced now it’s a subtle enough issue that it would be premature to start scanning the source code. Thanks @dh024.

Done them all. Made sure there were only single entries in Lastpass. Cleared the vault three times and purged before importing. No luck.

Finally, I just opened it on my desktop machine and manually deleted alternate entries. :slight_smile: Going forward, I will manually add rather than import because I am using BW in my mobile devices and LP on my desktop.