# Migration of knowledge base articles to Swarmica
Importing articles into Swarmica. This article describes how to import articles in `.md` file format into Swarmica.

### Instructions

:::tip
Recommendation: Name the `.md` file after the article's topic. For example, if the article's topic is 'How to create a ticket,' then the recommended file name is 'How to create a ticket.md'.
:::

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

2. Create the folder `/root/swarmica/old_articles`:

```bash
mkdir /root/swarmica/old_articles
```

3. Upload the articles (`.md` files) to the created folder `/root/swarmica/old_articles`.

4. Create a backup of the file `/root/swarmica/docker-compose.yml`:

```bash
cp /root/swarmica/docker-compose.yml{,.backup}
```

5. Mount the folder with the articles into the `django` container. To do this, add the following line to the `/root/swarmica/docker-compose.yml` file in the `django` container section:

```yaml
<...>
  django: &django
    image: reg.gl.swd.im/swarmica/backend:{SW_BACKEND_VERSION}
    depends_on:
      - postgres
      - redis
    volumes:
      - swarmica_ai_assistant:/swarmica/swarmica/ai_assistant/articles/:z
      - swarmica_runtime:/swarmica/swarmica/runtime_scripts/:z
      - swarmica_static:/swarmica/swarmica/static:z
      - swarmica_ugc:/swarmica/swarmica/attachments:z
      - swarmica_uploads:/swarmica/swarmica/uploads/:z
      - /root/swarmica/old_articles/:/swarmica/swarmica/old_articles/:z   # <------ This line
<...>
```

And restart Swarmica:

```txt
docker compose down; docker compose up -d
```

6. Log in to the Swarmica UI as an Administrator.

7. Create a new script in **Swarmica - Settings - Scripts** with the **Administrator** role.

![](https://support.swarmica.com/attachments/w/z/wzKsR7UqVblJr9_x_a/изображение.png)

8. In the script settings, add this [script](/attachments/w/y/wydiByftj4BNKDY4_a/article_import.py) and the following to **Web Form Parameters** and click **Save**:

```json
[
  {
    "name": "author_uid",
    "type": "string",
    "required": false,
    "displayName": "Author's UID"
  },
  {
    "name": "category_name",
    "type": "string",
    "required": true,
    "displayName": "Article Category Name"
  }
]
```

It should look like this:

![](https://support.swarmica.com/attachments/y/N/yN_oPXANu24bNL8Z_a/изображение.png)

9. In the web form of the script, specify the UID of the user who will be assigned as the author of the articles and the Name of the article category, then click Send:

![](https://support.swarmica.com/attachments/u/o/uosV0wAFeF6YqZ1__a/изображение.png)

10. On the Swarmica server, in the `/root/swarmica/docker-compose.yml` file, remove the line added in step 5 and restart Swarmica:

```bash
docker compose down; docker compose up -d
```