# Import data from Datatable

Buzzy provides a method for transferring data from one Datatable to another by using [Import data from URL](/the-building-blocks/datatables-fields-and-data/importing-data-from-a-url.md). A good understanding of the [Buzzy REST API](/rest-api/buzzy-rest-api/rest-api.md) is helpful.

### Steps

1. If required, schedule a maintenance period to transfer the data.
2. Stop all the traffic to the source Datatable
3. Create an empty Datatable (Application) for the destination
4. Select the Properties, Advanced, Data Source, URL Import.
5. Enter the JSONata script
6. Preview the results and make any required changes
7. Select Import
8. Validate the counts for insert and upsert in the message window

### Example JSONata import script

```
{
  "variables": {
    "host": "https://ssc.preciselydemos.com"
  },
  "secrets": {
    "username": "",
    "password": ""
  },
  "source": {
    "description": "Get data from Buzzy",
    "type": "url",
    "config": {
      "resultObject": "content",
      "url": "https://ssc.preciselydemos.com/api/microappdata",
      "method": "POST",
      "paging": {
        "param": "skip",
        "data": [
          "searchFilter",
          0,
          "skip"
        ],
        "check": "$count(body.microAppRows)>0",
        "increment": 1000,
        "start": 0
      },
      "headers": {
        "X-Auth-Token": "<your Buzzy Token>",
        "X-User-Id": "<your Buzzy User Id>"
      },
      "params": {},
      "auth": {
        "user": "{{username}}",
        "pass": "{{password}}"
      },
      "data": {
        "microAppID": "3193e251fb056b5df56b9298",
        "searchFilter": [
          {
            "resourceID": "3193e251fb056b5df56b9298",
            "order": 1,
            "field": "1",
            "limit": 1000,
            "skip": 0
          }
        ],
        "buzzyFormat": false
      }
    },
    "transforms": [
      "$.body.microAppRows",
      "$.($each(function($v, $k){$k=\"location\"?{$k:$eval($v)}:{$k:$v}}) ~> $merge())"
    ]
  },
  "fields": [
    {
      "key": "_id",
      "type": "String",
      "unique": true
    },
    {
      "key": "location",
      "type": "GeoJSON"
    }
  ]
}
```

***


---

# 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.buzzy.buzz/the-building-blocks/datatables-fields-and-data/import-data-from-datatable.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.
