# Unable to migrate FILE messages

**URL:** <https://community.sendbird.com/t/unable-to-migrate-file-messages/4152>\
**Category:** API\
**Tags:** migration\
**Created:** [March 11, 2022, 7:44am UTC](https://community.sendbird.com/t/unable-to-migrate-file-messages/4152 "2022-03-11T07:44:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sam/32/2111_2.png) [@sam](https://community.sendbird.com/u/sam)\
**Post date:** [March 11, 2022, 7:44am UTC](https://community.sendbird.com/t/unable-to-migrate-file-messages/4152/1 "2022-03-11T07:44:44Z")

</div>

I’m trying to migrate messages from an old chat solution, but any FILE messages I send are being recorded as MESG messages with no file or message data. An example of what I’m sending:

```auto
{
      "type": "FILE",
      "user_id": "2fe7a6c4-7732-435f-9685-c5c5bcdf4bed",
      "timestamp": 1626940111933,
      "url": "https://testimages.nebo.global/dbd6a88a-3d8a-44bd-bb32-588cfbca10f5.jpg",
      "file_name": "dbd6a88a-3d8a-44bd-bb32-588cfbca10f5.jpg",
      "file_type": "jpg",
      "file_size": 171945,
      "custom_type": null,
      "data": null,
      "dedup_id": null
    }

```

Which then returns from a fetch

```auto
    {
      "message_survival_seconds": -1,
      "custom_type": "",
      "mentioned_users": [],
      "updated_at": 0,
      "is_op_msg": false,
      "is_removed": false,
      "user": {
        "require_auth_for_profile_image": false,
        "is_active": true,
        "role": "",
        "user_id": "2fe7a6c4-7732-435f-9685-c5c5bcdf4bed",
        "nickname": "Sam Ritchie",
        "profile_url": "https:\/\/testimages.nebo.global\/93fdd281-9f86-4b18-ab82-9af75331fa18.jpg",
        "metadata": {}
      },
      "file": {},
      "message": "",
      "data": "",
      "message_retention_hour": -1,
      "silent": false,
      "type": "MESG",
      "created_at": 1626940111933,
      "channel_type": "group",
      "mention_type": "users",
      "channel_url": "960b596a-04cd-4594-9f4c-52647a529c8e",
      "message_id": 6782468526
    }

```

would appreciate any feedback as to where I’m going wrong, thanks.

---

<div class="post-metadata">

**Author:** ![Chinmaya\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/chinmaya_gupta/32/1021_2.png) [@Chinmaya\_Gupta](https://community.sendbird.com/u/Chinmaya_Gupta)\
**Post date:** [March 11, 2022, 12:18pm UTC](https://community.sendbird.com/t/unable-to-migrate-file-messages/4152/2 "2022-03-11T12:18:48Z")

</div>

Hello, @sam Welcome to Sendbird Community and I can see that you are able to create a community post successfully now 🙂

You’re not doing anything wrong. The thing is migration API does not support file messages (only if you have them from URL. Then yes, you point to the original URL).

But if you want to bring the file itself to the Sendbird server, then you need to use Platform API (a normal process for sending a FILE message).

Unfortunately, you cannot migrate FILE messages.

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sam/32/2111_2.png) [@sam](https://community.sendbird.com/u/sam)\
**Post date:** [March 11, 2022, 1:30pm UTC](https://community.sendbird.com/t/unable-to-migrate-file-messages/4152/3 "2022-03-11T13:30:02Z")

</div>

That’s correct, I am supplying a file URL, not a file (see the testimages.nebo.global URL in the migration message), as per the migration documentation - [Migration | Chat Platform API | Sendbird Docs](https://sendbird.com/docs/chat/v3/platform-api/guides/migration) - which specifies how to migrate FILE messages.

However, the migration is not properly creating the message as FILE and returns me empty MESG messages instead.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sam/32/2111_2.png) [@sam](https://community.sendbird.com/u/sam)\
**Post date:** [March 11, 2022, 1:36pm UTC](https://community.sendbird.com/t/unable-to-migrate-file-messages/4152/4 "2022-03-11T13:36:08Z")

</div>

Ah, sorry, I’ve spotted it - the properly should be `message_type`, not `type` as it is elsewhere.
