Importing Records that are Duplicates
Hello - I noticed that when we import records through the Keeper GUI, if there are duplicates of existing records, it seems to either create links/shortcuts to the existing records, or not create the new record at all in some cases (I haven't exactly nailed down when it does one vs. the other). So I looked at importing via the CLI to see if there were some more options, and I see there is an --update option which seems to imply that if specified, it would update existing records (and conversely, if not specified, it would create a new/duplicate record).
However, when I run import without --update (using structured JSON data) with a record that has an exact match already existing, no new record gets created. And when I run it with --update, I get the same behavior.
In this case, I want to import these matching records as duplicates. Is there a way to do this via Keeper Commander (or using any other method)? Any advice would be much appreciated. Thanks!
Both GUI and CLI try to prevent creation of duplicates for exactly matching records.
The matching records are ether skipped or import creates a link.
CLI has additional option --update that does not exist in GUI.
This option excludes password field from record matching, so passwords can be updated instead of creating duplicates.
The duplicates can be created if records in the import file are slightly modified. For instance notes field Or you can import all records into a shared folder then move that folder to another account (add a new account and remove existing). Your vault is going to be empty and the records can be imported one more time.
Thanks for the information! I was able to use the option of modifying a field (in this case adding an [A] after each title for "archive") in each record to be able to import a second copy of all records, and it worked well. Also thanks for explaining the --update option - that makes sense.
My only remaining question is - when it sees a duplicate that a user is attempting to import, how does Keeper decide when it will create a shortcut to the existing record vs. when it will not create anything at all? I've noticed if I try to import an identical record via the GUI, it seems to create a shortcut (most of the time?) but if I try to import an identical record via the CLI (without --update), it doesn't create anything. Do you know what the rules are around this?
A record instance may belong to multiple folders. When import finds a matching record but does not find this record in the folder it creates a record link.
"title":"Facebook",
"folders": [
{
"folder": "Social Media"
},
{
"shared_folder": "Shared Social",
"can_edit": false,
"can_share": false
}
],
In this example, if the record does not exist then it will be created in "Social Media" folder then linked to "Shared Social" shared folder else the links will be created if the folders do not have this record yet. Import does not delete/unlink any record.
GUI (javascript) and CLI (python) do not share any code. So, it id s possible that import behaves differently. Probably CLI has a bug that prevents link creation. GUI (the Web Vault) is the major company product. It is widely used and well tested.
Did I understand correctly that the Commander (CLI) does not link records to the folders?
That's correct - from my testing, when I import records that are an exact match of existing vault records via the CLI, the folder structure of their containing folders gets created but not the records themselves (not even as shortcuts/links to the existing records). Although my import situation was a bit different from the one you outlined - rather than my records having multiple folders defined for a record in the JSON, in this case I already had exact matching records in the vault from a previous import and I then attempt to import the same records again (but to a different root folder using the --folder option on the CLI). And that is where I see no records being created.
In contrast, when I execute the same scenario via the GUI, the second import with identical records being imported to different folders results in shortcuts being created for each record (with each shortcut pointing at the corresponding match that already existed in the vault).
A side note, during the little test I did just now I also saw that the CLI doesn't appear to work with specifying a second-level folder as the root to import to; for example, using --folder FOLDER_A works great to import all records under the existing folder FOLDER_A, but if FOLDER_A has a subfolder called FOLDER_B and I try to run import --folder "FOLDER_A/FOLDER_B", that just results in a new top-level folder being created with the name "FOLDER_A/FOLDER_B". Not sure if that is by design or not but thought I would bring it up just in case.