> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.omni.co/feedback

```json
{
  "path": "/visualize-present/dashboards/migrate",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Migrating dashboards

> Change the connection a dashboard is based on using Omni's APIs.

Instead of creating and building a new dashboard from scratch, you can use Omni's APIs to make the changes programmatically.

## Requirements

To follow the steps in this guide, you'll need:

* **Some familiarity with APIs**. This guide uses the command line to make API requests, which requires some technical know-how.

* **Permissions in Omni that allow you to**:

  * Create an API key (**Settings > API keys**)
  * Access the model IDE

* **An Omni dashboard you want to migrate**.

## Steps

<Steps>
  <Step title="Retrieve the dashboard ID">
    The first step is to retrieve the dashboard's unique ID. You can do this by:

    * **Using the dashboard's URL**. The string after `/dashboards` is the dashboard's ID; for example: `https://blobsrus.omniapp.co/dashboards/1c5e3040`

    * **Opening the document settings**. Navigate to **File > Document settings**. The [**Identifier** field](/share/#changing-document-urls-and-identifiers) contains the dashboard ID:

          <img src="https://mintcdn.com/omni-e7402367/rE0DLfCWKMXIHEkL/images/docs/finding-content/assets/images/dashboard-id-f3eb579514e863e57f560873f064e828.png?fit=max&auto=format&n=rE0DLfCWKMXIHEkL&q=85&s=c5d7b747adb7c9baa4c6596135993237" alt="" width="700" height="595" data-path="images/docs/finding-content/assets/images/dashboard-id-f3eb579514e863e57f560873f064e828.png" />
  </Step>

  <Step title="Export the dashboard">
    Next, you'll export the dashboard you want to migrate. Use the following as a template for your `GET` request:

    ```json wrap title="Template for GET /api/unstable/documents/:dashboardId/export" theme={null}
    curl -L 'https://<YOUR_OMNI_ORG>.omniapp.co/api/unstable/documents/<DASHBOARD_ID>/export' \
    -H 'Authorization: Bearer <YOUR_API_TOKEN>' \
    -H 'Content-Type: application/json'
    ```

    For example, the following request is for the `blobsrus` organization and exports the `1c5e3040` dashboard:

    ```json wrap title="GET /api/unstable/documents/:dashboardId/export" theme={null}
    curl -L 'https://blobsrus.omniapp.co/api/unstable/documents/1c5e3040/export' \
    -H 'Authorization: Bearer <TOKEN>' \
    -H 'Content-Type: application/json'
    ```

    A successful request will return a JSON object with the following structure:

    ```json wrap title="Successful response" theme={null}
    {
      "dashboard": {...},           // Contains details about the dashboard; truncated for simplicity
      "document": {...},
      "exportVersion": "0.1",
      "workbookModel": {...},
      "fileUploads": [...]          // Spreadsheet file data, if the dashboard contains spreadsheet tiles
    }
    ```

    If the dashboard contains spreadsheet tiles, the response will include a `fileUploads` array with the spreadsheet file data. This data is automatically included in the export and will be restored when you import the dashboard.

    Copy the response into a text editor, as you'll be editing it in the next step.
  </Step>

  <Step title="Retrieve the new model ID">
    The next step is to retrieve the ID for the model that the new dashboard should be built on.

    1. In Omni, navigate to **Settings > Model** and click the model to open it in the IDE.

    2. Locate the string between `/models/` and `/ide` in the URL:

       ```bash wrap theme={null}
       https://blobsrus.omniapp.co/models/d37d0698-4558-41aa-b7f7-66ff85e89e9d/ide
       ```

       In this example, the model ID is `d37d0698-4558-41aa-b7f7-66ff85e89e9d`.

    3. Add following `baseModelId` property to the response body from step 2 of this guide. Replace the value with the ID of the new model:

       ```json theme={null}
       "baseModelId": "<NEW_MODEL_ID>",
       ```

       The updated JSON should have the following structure:

       ```json wrap title="Example model ID" highlight={2} theme={null}
       {
         "baseModelId": "d37d0698-4558-41aa-b7f7-66ff85e89e9d",
         "dashboard": {...},
         "document": {...},
         "exportVersion": "0.1",
         "workbookModel": {...}
       }
       ```
  </Step>

  <Step title="Import the new dashboard">
    The last step is to import the dashboard. Start by using the following template to set up the API request:

    ```json wrap title="Template for POST /api/unstable/documents/import" theme={null}
    curl -L -X POST 'https://<YOUR_OMNI_ORG>.omniapp.co/api/unstable/documents/import' \
    -H 'Authorization: Bearer <YOUR_API_TOKEN>' \
    -H 'Content-Type: application/json' \
    -d '{
       <UPDATED_JSON_FROM_STEP_3>
    }'
    ```

    Replace `<UPDATED_JSON_FROM_STEP_3>` with the modified JSON from the previous step. Your request should look something like this:

    ```json wrap title="POST /api/unstable/documents/import" theme={null}
    curl -L -X POST 'https://blobsrus.omniapp.co/api/unstable/documents/import' \
    -H 'Authorization: Bearer <TOKEN>' \
    -H 'Content-Type: application/json' \
    -d '{
      "baseModelId": "d37d0698-4558-41aa-b7f7-66ff85e89e9d",
      "dashboard": {...},
      "document": {...},
      "exportVersion": "0.1",
      "workbookModel": {...},
      "fileUploads": [...]
    }'
    ```

    <Note>
      If the export response includes a `fileUploads` array, include it in your import request to restore any spreadsheet tiles. The spreadsheet file data will be uploaded and linked to the imported dashboard automatically.
    </Note>

    A successful request will return a JSON object similar to the following:

    ```json wrap title="Successful response" theme={null}
    {
      "dashboard": {
         "dashboardId":"31b55e13-abd8-4ba8-b78c-c5afb0e4ed43"
      },
      "miniUuidMap": {
         "nY8mm3PM":"c_afY5V5"
      },
      "workbook": {...}       // Details about the workbook; truncated for simplicity
    }
    ```
  </Step>
</Steps>

## What's next?

At this point, you should be able to access the new dashboard. Further updates may be required, such as updating the corresponding model details to align topics, custom fields, and so on.

To learn more about the content migration APIs, refer to the API references:

* [Export a dashboard API reference](/api/content-migration/export-dashboard)
* [Import a dashboard API reference](/api/content-migration/import-dashboard)
