This tool ONLY backs up entries in mounted bases, so if you are wanting to make a backup of some secrets but not others, make sure you unlock all the secret bases you want backed up, and UNMOUNT any you don't want backed up.
## **Important note 2**
This tool ALWAYS restores to the most recently unlocked basis, so if you desire to have the entries spread across multiple secret bases, you'll want to split the JSON file into separate files before attempting to import/restore the secrets so you can import only the necessary secrets for each mount. Once you've made a backup or a few (one for just the System "less secret" entries and one with additional secret bases unlocked), you will notice that the System entries show up in EVERY backup. If you want to quickly strip those out, you can use the handy python package `jsondiff` for this. `pip install jsondiff` and then `jdiff system-backup.json secretbase1.json -p -i 2` will output only the unique entries from the second file, so you could redirect this to a new file with a name that reminds you of the basis it should get imported to.
If `zbarcam` can't decode a dense QR code with multiple TOTP exports, try selecting just one TOTP code at a time, and then exporting them in series. The commands will automatically collate all the individually read QR codes.
Passwords may be imported from a CSV file with a two-step process. The first step is to run the following command:
```bash
$ vaultbackup-rs format csv-pass your_passwords.csv
```
This will read in a CSV and output a JSON file named `csv_to_vault_passwords.json`, suitable for restoring to `vault`. The second step is to do the actual restore operation, using the `restore` command, referencing the generated JSON fle. The intermediate JSON file may be inspected to ensure that the full CSV contents were translated correctly.
:warning: it takes a few minutes to upload a couple hundred passwords!
`vaultbackup-rs` will appear to "hang" while it is running if you have a lot of passwords to upload. It takes a long time because each password is atomically committed and synced to the cryptographic store individually.
`site` and `username` are mandatory fields; `password` and `notes` may be left blank, but the comma delimiters are still required to indicate the blank fields.
The CSV file may contain any valid UTF-8 characters, and anything between double quotes `"` is interpreted as a single field. For example:
```
site,username,password,notes
test.com,bunnie,f00b4r,a test password
commas.net,troll,"c0mm4,c,c","a site that loves commas,
and a new line in a CSV,,,"
simple_site,username only,,
```
The above CSV file contains three entries. `test.com` is the base case. `commas.net` shows how both the extra commas and the newline in the `notes` field are captured within a single field, because they are surrounded by `"`. `simple_site` shows a record with only a username, and no password or notes; note the two trailing commas holding the place for the blank `password` and `notes` fields.
The current implementation bails ungracefully if any lines are encountered without the correct number of fields. Here is an example of the error message in this case:
The parser expects 4 fields (`expected_len`), but the actual length in ths case was 5 (so the problem is an extra comma).
If you are using unicode and/or special characters in your file, and you run on Windows, be sure to export the CSV with the correct encoder settings. Windows defaults to UTF-16, but Rust only operates on UTF-8.