> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/omnitron/integration/migration/old-order-migration.md).

# Old Order Migration

The migration file can be in csv, xls or json format. The column names of the migration file must match the file names in the table below. It allows Old order migrations can be made with the file. Migration processes can be sustained with this process. The data is taken with a file in a simple format and then transferred to the shop (Commerce) application via the shell with the script run on the backend.

<table data-header-hidden><thead><tr><th width="129.74609375"></th><th width="102.84765625"></th><th width="97.17578125"></th><th></th></tr></thead><tbody><tr><td><strong>Field Names</strong></td><td><strong>Data Type</strong></td><td><strong>Required</strong></td><td><strong>Descriptions</strong></td></tr><tr><td>number</td><td>string</td><td>true</td><td>Order ID (Max 128 Characters)</td></tr><tr><td>user</td><td>string</td><td>true</td><td>The customer code of the user</td></tr><tr><td>user_email</td><td>string</td><td>true</td><td>The email of the user</td></tr><tr><td>status</td><td>string</td><td>true</td><td>Order status code](/docs/guide/integration/order/order-status)<br>(Max 64 Characters)</td></tr><tr><td>created_date</td><td>date</td><td>true</td><td>The creation date of the order</td></tr><tr><td>amount</td><td>float</td><td>true</td><td>Max digits:12, max decimal place: 2</td></tr><tr><td>discount_amount</td><td>float</td><td>false</td><td>Max digits:12, max decimal place: 2</td></tr><tr><td>currency</td><td>string</td><td>true</td><td>(/docs/guide/integration/migration/migration-property-choices)</td></tr><tr><td>payment_type</td><td>string</td><td>true</td><td>Max 64 characters</td></tr><tr><td>bank</td><td>string</td><td>true</td><td>Max 64 characters</td></tr><tr><td>installment_count</td><td>integer</td><td>false</td><td>Minimum value is 1 if provided</td></tr><tr><td>tracking_number</td><td>string</td><td>true</td><td>Max 64 characters</td></tr><tr><td>shipping_company</td><td>string</td><td>true</td><td>(/docs/guide/integration/migration/migration-property-choices)</td></tr><tr><td>shipping_address</td><td>string</td><td>true</td><td>Max 512 characters</td></tr><tr><td>billing_address</td><td>string</td><td>true</td><td>Max 512 characters</td></tr><tr><td>extra_field</td><td>json</td><td>false</td><td>The extra information that should be kept in the order</td></tr></tbody></table>

***

| **Parameter** | **Data Type** | **In** | **Descriptions**                                                      |
| ------------- | ------------- | ------ | --------------------------------------------------------------------- |
| channel\_id   | integer       | url    | The id of the shop channel                                            |
| api\_token    | string        | header | [The API key of the customer’s account](/omnitron/getting-started.md) |
| files         | disct         | body   | The dictionary includes the file descriptor or the migration file     |
| migration\_id | string        | url    | The type of migration (user, address, order, order\_item etc.)        |

A request is sent to start the migration to the endpoint related to the parameters in the table given above.

The flow continues with the data in the file sent with the `files` parameter.

### Request POST

In order to initiate an address migration to the `/api/v1/remote/{channel_id}/migrations/start/{migration_type}` endpoint using the parameters mentioned above and trigger the queue, the migration key value is specified as order and a POST request is sent.

Path: `/api/v1/remote/{channel_id}/migrations/start/{migration_type}`

```python

import requests
import json

url = "https://{customer_api_url}/api/v1/remote/{channel_id}/migrations/start/{migration_type}/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
   'content-type': 'application/json',
   'Authorization': 'Token {}'.format(api_token)
}
files = {'file': open('/path/to/file/address.csv','rb')}
response = requests.post(url, headers=headers, files=files)
print(response.text)

```

#### Response

As a result of the request, it can be seen that the operation was carried out successfully with a 200 OK response code.

```json
{
  "migration_id": "4d6f7650799f484d875a89adf8d472b8"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/omnitron/integration/migration/old-order-migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
