﻿---
path: api-and-integrations/import-from-bitwarden.mdx
title: Import from Bitwarden
slug: import-from-bitwarden
pagination_next: null
pagination_prev: null
sidebar_position: 6
description: >-
  Import password, folders, and collections from Bitwarden to Passwork 7 with
  a Python script based on the official Passwork Python Connector.
keywords:
  - Passwork
  - Bitwarden
  - import
  - migration
  - Python
  - API
  - connector
  - vault
  - folder
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Passwork 7 supports migration from Bitwarden using a Python script built on top of the official [Python connector](/api-and-integrations/python-connector). The process is API-based and helps preserve your data structure while moving to an on-premise Passwork instance.

:::danger
Before running the import, create a Passwork database backup and test the process in a staging environment.
:::

## What is imported and what is not

### Imported

- Bitwarden items of type `login` and `secure note`;
- Bitwarden collections;
- folders from a Bitwarden personal vault export;
- item name, notes (`description`), login, password;
- URLs from `login.uris` (as URL list);
- TOTP (as a custom field with `totp` type);
- custom fields:
  - `type 0` and `type 2` -> `text`;
  - `type 1` -> `password`.

### Not imported

- Bitwarden attachments;
- item types other than `login` and `secure note` (they are skipped);
- unsupported custom field types (warning is written to log).

## Files

<div style={{ display: 'grid', gap: '0.65rem', marginTop: '1rem' }}>
  <a
    href="/tech-guides/files/import.py"
    download="import.py"
    style={{
      display: 'inline-flex',
      width: 'fit-content',
      alignItems: 'center',
      padding: '0.6rem 0.85rem',
      border: '1px solid var(--ifm-color-emphasis-400)',
      borderRadius: '8px',
      backgroundColor: 'transparent',
      color: 'var(--ifm-heading-color)',
      fontWeight: 500,
      textDecoration: 'none',
      lineHeight: 1.3
    }}
  >
    Download import.py
  </a>

  <a
    href="/tech-guides/files/requirements.txt"
    download="requirements.txt"
    style={{
      display: 'inline-flex',
      width: 'fit-content',
      alignItems: 'center',
      padding: '0.6rem 0.85rem',
      border: '1px solid var(--ifm-color-emphasis-400)',
      borderRadius: '8px',
      backgroundColor: 'transparent',
      color: 'var(--ifm-heading-color)',
      fontWeight: 500,
      textDecoration: 'none',
      lineHeight: 1.3
    }}
  >
    Download requirements.txt
  </a>
</div>

## Step 1. Export data from Bitwarden

This guide uses Bitwarden Web Vault as an example because organization export is available in the web interface.

:::info
If you need to export an individual (personal) vault from browser extension, desktop, or mobile app, use the relevant section of the [Bitwarden documentation](https://bitwarden.com/help/export-your-data/#export-an-individual-vault).
:::

1. Open Bitwarden and go to **Tools** → **Export**.

<ImageComponent
  src={'/img/assets/api-and-integrations-import-from-bitwarden-1.png'}
  alt="Open Export page in Bitwarden"
  format='regular'
/>

2. Choose organization export or specific vault export, select **JSON** → **Export**.

<ImageComponent
  src={'/img/assets/api-and-integrations-import-from-bitwarden-2.png'}
  alt="Choose JSON export format in Bitwarden"
  format='regular'
/>

3. Confirm export by entering your Bitwarden master password.

<ImageComponent
  src={'/img/assets/api-and-integrations-import-from-bitwarden-3.png'}
  alt="Confirm Bitwarden export with master password"
  format='regular'
/>

4. Make sure the `.json` file was downloaded successfully. This file will be used as input for `import.py`.

## Step 2. Prepare environment and run script

<Tabs className="tabs-container">
  <TabItem className="tab-item-container" value="linux-macos" label="Linux / macOS">

```shell
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 import.py ./bitwarden_export.json --host "https://passwork.example.com" --token "YOUR_ACCESS_TOKEN"
```

  </TabItem>
  <TabItem className="tab-item-container" value="powershell" label="PowerShell">

```powershell
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python import.py .\bitwarden_export.json --host "https://passwork.example.com" --token "YOUR_ACCESS_TOKEN"
```

  </TabItem>
</Tabs>

## Script parameters

### Required

- `file` — path to Bitwarden JSON export file;
- `--host` — Passwork host URL;
- `--token` — access token (`accessToken`).

### Optional

- `--master-key` — master key (when client-side encryption is enabled);
- `--refresh-token` — refresh token (`refreshToken`);
- `--vault-id` — existing vault ID for import target;
- `--collections` — comma-separated list of collection names or IDs.

## Run examples

### Import into separate vaults (by collections)

<Tabs className="tabs-container">
  <TabItem className="tab-item-container" value="shell-1" label="shell">

```shell
python3 import.py ./bitwarden_export_org.json \
  --host "https://passwork.example.com" \
  --token "YOUR_ACCESS_TOKEN"
```

  </TabItem>
</Tabs>

### Import selected collections only

<Tabs className="tabs-container">
  <TabItem className="tab-item-container" value="shell-2" label="shell">

```shell
python3 import.py ./bitwarden_export_org.json \
  --host "https://passwork.example.com" \
  --token "YOUR_ACCESS_TOKEN" \
  --collections "Collection 1,Collection 2"
```

  </TabItem>
</Tabs>

### Import into an existing vault

<Tabs className="tabs-container">
  <TabItem className="tab-item-container" value="shell-3" label="shell">

```shell
python3 import.py ./bitwarden_export_org.json \
  --host "https://passwork.example.com" \
  --token "YOUR_ACCESS_TOKEN" \
  --vault-id "VAULT_ID"
```

  </TabItem>
</Tabs>

## Step 3. Interactive prompts

If optional arguments are not provided in CLI, the script may ask for them interactively:

```text
Input comma-separated list of collection IDs or names to export (optional):
Input Passwork vault ID to import data to (optional):
```

Press **Enter** to skip a prompt.

## Step 4. Confirmation and logging

Before import starts, the script prints a summary and asks for confirmation:

```text
The following collections will be exported: Private vault
Continue operation? (Y/N):
```

During execution, the script creates a log file in the current directory:

```shell
import-YYYY-MM-DD_HH-MM-SS.log
```

The log includes created vaults/folders, item import steps, and skipped data warnings.

## Arguments

To print all available arguments:

<Tabs className="tabs-container">
  <TabItem className="tab-item-container" value="help" label="shell">

```shell
python3 import.py --help
```

  </TabItem>
</Tabs>

<ImageComponent
  src={'/img/assets/api-and-integrations-import-from-bitwarden-4.png'}
  alt="import.py help output"
  format='regular'
/>
