> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerokeyusb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Credentials

> Restore from a backup or migrate from another password manager. Screen by screen, from the menu to imported data.

Import loads credentials (site, username, password and optionally a TOTP secret) from a CSV file over USB serial. It happens **after unlocking** the device and requires **physical authorization** via the Center button.

<Warning>
  Import **overwrites** the destination slots without asking. If you already have credentials, **create a backup** ([guide](/getting-started/creating-backups)) before continuing.
</Warning>

***

## Before you start

| You need                         | How to get it                                                                                          |
| -------------------------------- | ------------------------------------------------------------------------------------------------------ |
| The device unlocked with PIN     | Plug it in and enter your PIN                                                                          |
| A CSV file with your credentials | A previous export, or an export from 1Password / Bitwarden / Keepass adapted to the format (see below) |
| A serial tool                    | [Web manager](https://zerokeyusb.com/manager) (recommended), `screen`, `minicom`, PuTTY at 115200 bps  |

***

## Step 1 — Open the menu

While on the first credential, press **Left**.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-01-from-cred.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=1352b5bbd84788b3e19bc00a0c8ba6d0" alt="Open the menu from credential 1" width="884" height="283" data-path="images/steps/importing-credentials-01-from-cred.svg" />

*Press **Left** while on credential 1.*

***

## Step 2 — Enter the Backup submenu

In the root menu, **Backup** is selected by default. Press **Center**.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-02-backup-menu.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=6fb5982c307cef88c54a71d2b52151c0" alt="Root menu, Backup selected" width="884" height="283" data-path="images/steps/importing-credentials-02-backup-menu.svg" />

*Press **Center**.*

***

## Step 3 — Select "Import"

Inside Backup, `Import` is at the top. If it's not highlighted, press **Up** to reach it. Then **Center**.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-03-import-selected.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=08a97278bdbc13365cb30100b0a73d43" alt="Import selected" width="884" height="283" data-path="images/steps/importing-credentials-03-import-selected.svg" />

*With `Import` highlighted, press **Center**.*

***

## Step 4 — Physical authorization

Just like in export, an authorization screen asks for a long Center press before enabling the import channel.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-04-authorization.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=d533385691c49c3fae07bb7bd71a7af7" alt="Import authorization screen" width="884" height="283" data-path="images/steps/importing-credentials-04-authorization.svg" />

*Before continuing, prepare your CSV file on the host. When ready, **hold Center for \~1 second**. The device sends `REQUEST_SAVE` over USB serial waiting for the data.*

<Warning>
  **Don't press Center short by mistake** — a short press won't authorize anything (it just moves to the next menu screen if there is one).
</Warning>

***

## Step 5 — Send the CSV from the host

With the device in "waiting for data" mode, send over USB serial:

1. A line with the **total number of records** to import (example: `5`).
2. One CSV line per credential in this format:
   ```csv theme={null}
   slotIndex,site,username,password[,totpSecret]
   ```

Full example:

```csv theme={null}
5
0,github.com,alice,MyP@ss123,JBSWY3DPEHPK3PXP
1,gmail.com,bob@gmail.com,correct horse battery staple
2,bank.com,12345678X,s3cur3P@ss,JBSWY3DPEHPK3PXP;algo=SHA256
3,aws-prod,admin,A!7zQ#mYpL2v
4,banca,12345678X,Pin-only2FA
```

Each line is processed like this:

```
Host → device:   "0,github.com,alice,MyP@ss123,JBSWY3DPEHPK3PXP"
Device:          AES-128 CBC encrypt → write to EEPROM slot 0
Device → host:   "Record 1 stored correctly."
```

<Tip>
  The [web manager](https://zerokeyusb.com/manager) has a file picker that sends the lines in the right order and shows progress. If you don't want to fight with the terminal, use it.
</Tip>

***

## Step 6 — Progress

During import you'll see the slot being written and overall progress on screen.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-05-progress.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=a095da837a3e34ff2ad4ed9b191a19b6" alt="Import progress" width="884" height="283" data-path="images/steps/importing-credentials-05-progress.svg" />

*When done, the device shows "Import complete" for 1 second and returns to the menu. Press **Left** to exit to the credential list and verify they've been added.*

***

## Step 7 — Verify

Press **Left** repeatedly to exit the menu to the credential list. Navigate with **Left/Right** and check that the imported data appears.

<img src="https://mintcdn.com/depbit/oytr8oqa2a1UzETJ/images/steps/importing-credentials-06-verified.svg?fit=max&auto=format&n=oytr8oqa2a1UzETJ&q=85&s=e31ce25a864ccc335fe5abca96dc5602" alt="Imported credential on main screen" width="884" height="283" data-path="images/steps/importing-credentials-06-verified.svg" />

*Use **Right** to walk through the newly imported credentials. If everything looks good, consider making a [new backup](/getting-started/creating-backups) now.*

***

## CSV format

| Field        | Description            | Limit               |
| ------------ | ---------------------- | ------------------- |
| `slotIndex`  | Target slot            | 0–61                |
| `site`       | Site or service        | 16 characters       |
| `username`   | Username               | 16 characters       |
| `password`   | Password               | Any printable ASCII |
| `totpSecret` | (optional) TOTP secret | See below           |

### Accepted TOTP secret formats

| Format                | Example                                                                |
| --------------------- | ---------------------------------------------------------------------- |
| Bare Base32           | `JBSWY3DPEHPK3PXP`                                                     |
| Base32 + algorithm    | `JBSWY3DPEHPK3PXP;algo=SHA256`                                         |
| Full `otpauth://` URI | `otpauth://totp/GitHub:alice?secret=JBSWY3DPEHPK3PXP&algorithm=SHA256` |

Default algorithm if not specified: **SHA-1**.

***

## Validation and errors

| Case                          | Behaviour                                |
| ----------------------------- | ---------------------------------------- |
| `slotIndex` outside 0–61      | Reject the line: `"Index out of range"`  |
| Invalid Base32                | Reject the TOTP secret: `"TOTP invalid"` |
| Line with fewer than 3 fields | Skipped with an error log                |
| Empty line                    | Terminates the import early              |

***

## Migrating from other managers

To migrate from 1Password, Bitwarden, Keepass and others:

1. Export to CSV in the source manager.
2. Adapt the CSV to the ZeroKeyUSB format (a simple Python script — trim each field to 16 chars and reorder columns).
3. Import following this guide.

<Tip>
  There are conversion script templates in the [tools repo](https://github.com/Depbit-lab/zerokeyusb-tools) — `tools/convert_<source>.py`.
</Tip>

***

## Next steps

<CardGroup cols={2}>
  <Card title="Create a backup" icon="cloud-arrow-down" href="/getting-started/creating-backups">
    Export the freshly imported data before doing more work.
  </Card>

  <Card title="2FA codes" icon="clock" href="/getting-started/totp-codes">
    If you imported TOTP secrets, see how to view and type them.
  </Card>
</CardGroup>
