Importing from json file

I try to import my passwords from another password manager via a json file, that I build myself. On testing with just one password I notice that sometimes the file is accepted but sometimes nothing happens at all. How can this be? And no, I’m not using the same userid/passwd twice.

The two userid/passwd that I managed to import ended up in the “no folder”. I’d like to store them in a specific folder. How can I do that? I cannot enter the foldername in an item, but only a folderId, which is a long string of characters. Do I have to create a folder item in the json to connect a name to this string?

1 Like

Hi @Brandt59 - welcome!

If you haven’t seen this help document yet, you might find it helpful:
https://bitwarden.com/help/article/condition-bitwarden-import/

This thread might also be helpful (it is about CSV imports, but the issues with long Notes might be applicable to your case):

If repeating the same action with the same data generates different results each time, then there is a significant bug. If so, it would be very helpful to report that bug on Bitwarden’s GitHub repo.

OK, it turns out that Bitwarden fails quietly if there is an error in the json. With the help of a json checker, I corrected my json and now it works. Leaves me with the second question: how to import into a specific folder? Reusing the folderid of an existing folder (obtained via export) does not work: the new items get into ‘no folder’. And defining the folder myself in the json, even if the folder already exists, just makes Bitwarden create another folder with the same name.

How about if you create a sample folder with some items directly inside Bitwarden, then export your sample data as json and then take a look at the structure inside that json file?

My thought exactly. Re-using the forumId I find there doesn’t do the trick; items end up in the ‘no folder’

Just to be sure, you are following the guidance here, right?
https://bitwarden.com/help/article/condition-bitwarden-import/#condition-a-json

Note: there is also a sample JSON import file provided.

I played around with this issue a bit, and I see the same behaviour:

  • If a folders property is defined ion the JSON import file, you cannot re-use existing folder id values - new folder ids are always created during the import, and the result is new folders with duplicated folder labels in the BW vault
  • If the folders property in the JSON file is omitted, but existing folder ids are used for items that you wish to import, these folder ids are ignored and the imported items end up using the ‘No Folder’ label.

So, the import routines used by BW do not allow one to insert new items within existing folders, which may be by design. Perhaps the best you can do is define a new folder (with a label like “Import”) and then bulk move the imported items into the correct folder in the vault, which is easy if you only have one folder:

If you have a lot of folders, I can see how this could be tedious. I guess you could define new folders in your JSON file like Alpha.import and Beta.import to keep things organized for bulk moves, but obviously, that’s going to be a lot of work if you have numerous folders.

@Brandt59 - you might consider adding a feature request to allow inserting imported items into folders and see if it gets any traction. Sorry - I am not sure what else to suggest!

Thanks, that confirms my findings. And the work-arounds you propose will get the job done. So no immediate need for product enhancement there. Only maybe, put those limitations in the documentation. That will save time finding out that somethings just are not possible.

1 Like