Mass delete 630 passwords that I imported from Google

Hi all

So a few days ago I imported 630 passwords from an old google account. I put them directly into a separate folder within my vault. I quickly realised that they are mostly old and unused, and they’re massively clogging up my bitwarden vault. So decided to keep the password separately on an excel spreadsheet, in the original csv that was exported from google, and delete them from bitwarden.

I then deleted to folder within bitwarden. However, it hasn’t deleted the passwords and has just put them in my main vault, mixed in with all my other passwords.

I cannot find anyway to either restore the folder so that the passwords will hopefully go into there, making it easy to delete them, or undo the action of importing them.

Please tell me there is a way to do this!?!

Many thanks

Jay

Hello Jay and welcome to the community.

No, there isn’t a way to “undo” folder deletion.

If you have a backup of Bitwarden vault before the import, you can just delete everything and import from the backup.

Otherwise, you may have to delete manually, or use a script and CLI to delete using your CSV, although this is probably dangerous from the standpoint of erroneously deleting something you don’t want because of the script’s bug / similar entries.

If you didn’t have a backup before, maybe now would be a good time to make regular backups going forward.

Hi,

Thanks very much for your response. I don’t have a backup unfortunately but definitely a fair point about making them going forward.

Is there any way to filter by date added or something like that? Surely there has to be a way to bring those recently added passwords together or at least get them to appear in order - I don’t mind having to manually click each one, it just seems like such a very basic function and not really something I would expect to be missing.

Just read a feature request, from 2018, for this kind of feature - but yet something so basic still doesn’t appear.

I will be finding an alternative password manager if there is no way around this, as its going to take me several hours to sort this out.

Thanks again

You would have been fine if you had just mass deleted the folder contents before deleting the folder itself, but now your only option to clean up the mess using Bitwarden (besides a manual hunt-and-peck) would be doing this by means of a script using the CLI. @Neuron5569’s suggestion of making use of your Google export file is also good, and may not even require use of the CLI — instead, export your Bitwarden vault in .CSV format, which will allow you to remove the recently imported data as follows:

:one:   Open the Bitwarden .CSV export file in Excel, and insert 630 empty rows between the column headers and the first Bitwarden vault item.

:two:   Find one or more data columns in your Google export that will uniquely match only items that you had previously imported (and not match any items that were in your vault prior to the recent Google import) — if you don’t think it’s possible to avoid duplicates that are indistinguishable from pre-existing vault items (from before the Google import), then some additional data conditioning procedures will be needed before proceeding. Assuming that you find a set of suitable columns, copy the corresponding data (omitting the column headers) from the Google export file into the empty rows that you had created (starting at Row #2) in the Bitwarden .CSV file — place the copied data in the appropriate column(s), where the duplicate data can be found, and make a note of the column headers. Important: Do not paste any data into the type column!

:three:   Next, select all non-empty columns and rows in the Bitwarden .CSV, and open the data de-duplication tool (in my version of Excel, this can be found under Data > Data Tools > Remove Duplicates). Enable the option “My data has headers” before proceeding. Deselect all columns, then select only those columns where you had pasted data in Step :two: above. Click OK; you should seen a success notification that says something to the effect “630 duplicate values were found and removed”.

:four:   In the deduplicated Bitwarden .CSV file, delete Rows 2–631 (i.e., the data that you had pasted from the Google export); completely remove the rows — don’t just clear their contents. When you are done, there should be no rows left that have an empty value in the type column.

:five:   Save the modified .CSV file, purge the contents of your vault, and import the modified .CSV file by specifying the file format as “Bitwarden (csv)”.

If you’re going to attempt the above, I would strongly advise that you also create a password-protected .JSON export before starting, and (if you have a Premium subscription) ensuring that you have backup copies of any files that you may have attached to your vault items.

There is a created date at the bottom of each vault entry in view mode. Unfortunately, within the Bitwarden apps, there is no way to sort on it.

In addition to the earlier suggestions, you could create a password-protected JSON export and import that into KeepassXC, which does display and can sort on the modified date. Then, in KeePassXC, export to a XML File and within Bitwarden, import with “Keepass 2 (XML)” format.

You could also create an unencrypted JSON export. It is a “somewhat readable” format that can be edited with the likes of notepad. If you go this route, I would simply change the name of the targeted entries and then delete them after reimporting into Bitwarden, to avoid the complexities of matching brackets.

As you learned, importing does not overwrite entries, so before you import, create a fresh backup and then purge your vault.

Do be aware that file attachments and password-history are not saved in exports, so if these are important to you, make sure to first save them separately.

1 Like

The suggestion by @DenBesten to use KeePassXC to sort and clean up your data is a good idea (but I don’t think that their other suggestion — making an unencrypted JSON export — will help facilitate the task of identifying the entries to delete).

Here is a third possible work-around (besides the Excel de-duplication method and the KeePassXC sorting method), which will allow you to delete all of the imported Google items using 3 mouse clicks per item (but no searching or hunting for the items to delete). The drawbacks of this method are first, that it will only work if the vault items that you want to keep (those that existed prior to the Google import) all have unique passwords that differ from those that you were using in Google, and second, that it requires a Premium subscription ($10 USD).

To make the deletion process as simple as possible, first edit the Google export .CSV so that the item names get a prefix like zzz (to ensure that they will appear last when sorted alphabetically). Next, import this modified .CSV file into your Bitwarden account again, ensuring that you import everything into an empty folder (as you had done previously). Now, log in to the Web Vault, and run the “Re-Used Passwords Report”. If your original vault items all have unique passwords that differ from those that you were using in Google, then the only items in the report results should be the ones from your first (and second) Google import. Next you can go through all items one by one, to open the item, delete the item, and confirm (i.e., three clicks total), starting with those at the top of the list (which do not have the zzz prefix). Finally, open the folder where you had imported everything, click the “All” checkbox, and use the “Delete” option in the kebab menu available in the column headers (to the right of the “Owner” column heading); after the folder items have been deleted, you can delete the folder itself, as well.

This is essentially true. However with bitwarden cli you can pipe the json output to jq and filter by creationDate or revisionDate.

Eg.:

bw list items | jq -r '.[] | select(.creationDate>="2024-10-23" and .creationDate<"2024-10-24") | .creationDate + " " + .revisionDate + " " + .id + " " + .name'

Then, after verifying the list, you can delete them one-by-one with a script running this for every id to delete:

bw delete item <id>

1 Like

Another approach would be to sort the Google csv alphabetically by entry name and then use the webvault (https://vault.bitwarden.com or .eu) to checkmark the entries to be deleted. Then, bulk delete them with the three-dot menu in the table’s title bar.

The sole advantage of the unencrypted JSON export is that it exposes the creation date en masse, which is the only thing @jaystevenson identified as being common to the targeted entries.

I tend to stay away from anything that requires exporting, purging and then importing a CSV because it is damages entries that have passkeys, custom fields, etc.

Regarding Excel specifically, one might consider a temporary column that uses the vlookup command to flag entries in the Bitwarden CSV that also exist in the Google CSV.

Attachments, indeed, are not saved with a vault export. However, if you use bitwarden json format, password-history is exported and imported back.

The only data lost (besides attachments) with a bitwarden json export and import is item metadata (namely creation and revision timestamps).

Thanks for sharing that. Looked at my old exports. Apparently, that was added back in 2022.

Creation and Revision timestamps are also in the export; they are just not imported.

I haven’t checked recently, but when the password history export was initially implemented, the Bitwarden import did not read in the password history data from Bitwarden JSON imports (although evidently, Bitwarden’s import tool for 1PUX files did import passwords histories that had been exported by 1Password). Have you verified that the password history data is now imported from Bitwarden JSON files?

In addition, Sends are lost, and unless something has changed since I last checked, items in the Trash folder are also lost.

True! I can see a useful feature request here…

Yes, back in april.

Also true!

1 Like