# Importing organizations and clients from CSV
This article describes the instructions for importing organizations and clients from a CSV file.

:::caution
CSV file requirements:

* the file must have 3 columns: `client, email, organization`
* data must be separated by the ";" character

Example of CSV file contents:

```txt
client;email;organization
"James Rodriguez";"james_rodriguez_1658@example.tld";"Umbrella Co"
"Thomas Martinez";"thomas_martinez_4320@test.tld";"Hooli"
"Jennifer Lopez";"jennifer_lopez_8285@example.tld";"Massive Dynamic"
...
```
:::

# Instructions

1. Connect to the Swarmica server via SSH as the root user.

2. Create a backup of Swarmica using [these instructions](https://support.swarmica.com/article/ru/408-rezervnoe-kopirovanie-i-vosstanovlenie-swarmica-na-svoem-oborudovanii.html).

3. Upload the CSV file with the user list to the uploads folder in the django container:

```txt
docker cp <PATH-TO-CSV-FILE> swarmica-django-1:/swarmica/swarmica/uploads
```

where <PATH-TO-CSV-FILE> is the path to the CSV file.

4. Log in to the Swarmica web interface as Administrator

5. Create an import script in **Swarmica - Settings - Scripts** for the Administrator role:

![](https://support.swarmica.com/attachments/D/V/DV12fRTzrnl0hK9y_a/изображение.png)

6. Upload the script [import_organizations_and_clients.py](https://support.swarmica.com/attachments/F/f/Ffi4jCSmLSg3eDA9_a/import_organizations_and_clients.py), add the following **Web Form Parameters** and click **Save**:

```txt
[
  {
    "name": "filename",
    "type": "string",
    "required": true,
    "displayName": "CSV file name"
  }
]
```

It should look like this:

![](https://support.swarmica.com/attachments/k/1/k1g5vhSQkVTlRWcU_a/изображение.png)

7. In the web form field, enter the name of the CSV file uploaded in step 2, and click **Send**:

![](https://support.swarmica.com/attachments/T/i/TiX7qxP-ehhbiqKG_a/Без_имени.png)

## Troubleshooting

You can track the process in the celeryworker container log:

```bash
docker logs swarmica-celeryworker-1 -f
```

Or after the script runs:

```txt
docker logs swarmica-celeryworker-1 2>&1 | grep "User import"
```