|
| 1 | +--- |
| 2 | +title: Export |
| 3 | +description: "Migrate between instances with the `/export` route" |
| 4 | +--- |
| 5 | + |
| 6 | +import { RouteHighlighter } from '/snippets/route_highlighter.mdx' |
| 7 | + |
| 8 | +import CodeSamplesExperimentalDeleteLogsStream1 from '/snippets/samples/code_samples_experimental_delete_logs_stream_1.mdx'; |
| 9 | + |
| 10 | +Use the `/export` route to transfer data from your origin instace to a remote target instance. This is particularly useful when migrating from your local development environment to a Meilisearch Cloud instance. |
| 11 | + |
| 12 | +## Migrate database between instances |
| 13 | + |
| 14 | +<RouteHighlighter method="POST" path="/export" /> |
| 15 | + |
| 16 | +Migrate data from the origin instance to a target instance. |
| 17 | + |
| 18 | +### Body |
| 19 | + |
| 20 | +| Name | Type | Default value | Description | |
| 21 | +| ------------------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------- | |
| 22 | +| **`url`** * | String | `null` | The target instance's URL address. Required | |
| 23 | +| **`apiKey`** * | String | `null` | An API key with full admin access to the target instance | |
| 24 | +| **`payloadSize`** * | String | "50 MiB" | A string specifying the payload size in a human-readable format | |
| 25 | +| **`indexes`** * | Object | `null` | A set of patterns matching the indexes you want to export. Defaults to all indexes in the origin instance | |
| 26 | + |
| 27 | +#### `url` |
| 28 | + |
| 29 | +A string pointing to a remote Meilisearch instance, including its port if necessary. |
| 30 | + |
| 31 | +This field is required. |
| 32 | + |
| 33 | +#### `apiKey` |
| 34 | + |
| 35 | +A security key with full admin permissions to a secured Meilisearch instance. |
| 36 | + |
| 37 | +#### `payloadSize` |
| 38 | + |
| 39 | +The maximum size of each single data payload in a human-readable format such as `"100MiB"`. Larger payloads are generally more efficient, but require significantly more powerful machines. |
| 40 | + |
| 41 | +#### `indexes` |
| 42 | + |
| 43 | +A set of objects whose keys correspond to patterns matching the indexes you want to export. By default, Meilisearch exports all documents across all indexes. |
| 44 | + |
| 45 | +Each index object accepts the following fields: |
| 46 | + |
| 47 | +- `filter`: a [filter expression](/learn/filtering_and_sorting/filter_expression_reference) defining the subset of documents to export. Optional, defaults to `null` |
| 48 | +- `overrideSettings`: if `false`, uses the index settings as configured in the origin instance. if `true`, uses the target instance settings. Optional, defaults to `false`. |
| 49 | + |
| 50 | +### Example |
| 51 | + |
| 52 | +<CodeSamplesExportPost1 /> |
| 53 | + |
| 54 | +#### Response |
| 55 | + |
| 56 | +```json |
| 57 | +{ |
| 58 | + "taskUid": 2, |
| 59 | + "indexUid": null, |
| 60 | + "status": "enqueued", |
| 61 | + "type": "export", |
| 62 | + "enqueuedAt": "2025-06-26T12:54:10.785864Z" |
| 63 | +} |
| 64 | +``` |
0 commit comments