# Exporting and importing a model-based custom entity type

You can export a model-based entity type to an encrypted file. The export includes the entire configuration.

You can then import the entity type into another instance of Textual.

## Exporting an entity type

{% hint style="info" %}
Required global permission: Edit any custom entity type
{% endhint %}

From the details page for an entity type, to export the entity type:

1. Click the actions menu next to the entity type name, then click **Export Entity Type**.

<figure><img src="/files/D5sjKItsG9ih7eR4UBuY" alt=""><figcaption><p>Actions menu for a model-based custom entity type</p></figcaption></figure>

2. After it downloads the custom entity type to the encrypted file, Textual displays the encryption key that was used to encrypt the file, and that you will need when you import the entity type.\
   \
   To copy the key, click the copy icon.

<figure><img src="/files/X5rxTnUWEbIVXgcGnEZK" alt=""><figcaption><p>Export Entity panel with the encryption key for the exported custom entity type</p></figcaption></figure>

## Importing an exported entity type

{% hint style="info" %}
**Required global permission:** Must have one of the following:

* Create custom entity types
* Edit any custom entity type
  {% endhint %}

After you export a model-based custom entity type, you can import it into another instance of Textual.

When you import an entity type, you are prompted to provide the encryption key that Textual provided during the import.

You cannot use the import to update or replace an existing entity type. If there is already an entity type with the same name, the import fails.

Regardless of whether the imported entity type was complete and had an active model, it is inactive when it is imported. After the import, you can update the entity type to identify an active model.

To import an exported entity type:

1. On the **Custom Entity Types** page, click Import Entity Type.
2. On the **Import Entity** panel, to search for and select the exported file, click **Choose file**.

<figure><img src="/files/UcM5yDHfCoDrLMnJZYQp" alt=""><figcaption><p>Import Entity panel to select the exported file and provide the decryption key</p></figcaption></figure>

3. In the **Decryption key** field, paste the encryption key that you copied during the export.
4. Click **Import**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/textual/entity-types/entity-type-custom-model/entity-type-export-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
