# Integrating Folder, Topic, and Portal Structures into knowledgehub.json

To streamline the data import process, previously created folder, topic, and portal structures should be combined into a single `knowledgehub.json` file. This comprehensive file encapsulates all the necessary elements of the knowledge base, making it easier to manage and import into the eGain system.

## Components of knowledgehub.json

1. **Folders**:
  * Organize knowledge articles in a hierarchical structure.
  * Define the folder paths where articles will be stored.
2. **Topics**:
  * Group related articles for easy navigation.
  * Define the topics and assign articles to them.
3. **Portals**:
  * Specify the portals through which the knowledge content will be accessed.
  * Assign topics to the relevant portals.


## Example Structure

The following is an example of how the combined `knowledgehub.json` file might look:

```json

{
  "knowledge": {
    "folders": [
      {
        "name": "Purple Nile Retail - Sample Data",
        "description": "",
        "folders": [
          {
            "name": "Credit Cards & Payments",
            "description": ""
          }
        ]
      }
    ],
    "topics": [
      {
        "name": "Credit Card and Payments",
        "description": "",
        "addArticles": {
          "fromArticles": [
            {
              "path": "Purple Nile Retail - Sample Data/Credit Cards & Payments/E-Gift Cards"
            },
            {
              "path": "Purple Nile Retail - Sample Data/Credit Cards & Payments/Online Payments"
            }
          ]
        }
      },
      {
        "name": "Account Management",
        "description": "",
        "addArticles": {
          "fromArticles": [
            {
              "path": "Purple Nile Retail - Sample Data/Account Management/Profile Settings"
            }
          ]
        }
      }
    ],
    "portals": [
      {
        "name": "Customer Portal",
        "description": "",
        "addTopics": {
          "fromTopics": [
            {
              "path": "Credit Card and Payments"
            },
            {
              "path": "Account Management"
            }
          ],
          "fromFolders": [
            {
              "path": "Purple Nile Retail - Sample Data/Credit Cards & Payments"
            }
          ]
        }
      }
    ]
  }
}
```

## Creating the knowledgehub.json

1. **Combine All Components**: Merge the previously created folders, topics, and portals into a single JSON object under the `"knowledge"` key. Ensure the structure is well-formatted and each component is correctly nested.
2. **Save the File**: Save the combined structure as `knowledgehub.json`.