Skip to content

import

Adds the contents of an export to this vault, reading stdin when no path is given.

Terminal window
$ sefy import backup.json
imported 1 item
Terminal window
sefy --vault ./old.bak export --i-know-this-writes-plaintext \
| sefy --vault ./new.bak import

Each entry carries the identity its item had in the vault it came from. An entry whose identity is already here is skipped, so importing the same export twice does not double anything:

Terminal window
$ sefy import backup.json
imported 0 items
3 items already here, left alone

Skipped means untouched, not updated. An export is a snapshot, and it may easily be older than what is in the vault now — overwriting a password with one from last month is exactly the kind of quiet damage worth refusing. To bring newer contents across, use merge, which compares both sides and says so when it cannot decide.

Entries without an identity are always added. Exports written by sefy 0.1.x carry none, and neither does JSON written by hand — there is nothing to recognise them by, and matching on titles instead would silently collapse two accounts that happen to share a name.

The whole file is checked before anything is inserted, so a malformed entry halfway down cannot leave a half-imported vault behind. Either every item lands or none does.