> For the complete documentation index, see [llms.txt](https://ja.docs.monaca.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ja.docs.monaca.io/migration-guide/nifcloud/datastore/data-migration.md).

# データの移行

## NCMB データストアのエクスポート

ニフクラ Mobile Backendからのデータのエクスポートは、次の手順で行います。

1. ニフクラ Mobile Backendでプロジェクトにアクセスし、右上のアプリ設定をクリック

   <figure><img src="/files/recbIfhem5iJzizDTP5P" alt="" width="563"><figcaption></figcaption></figure>
2. メニューから「エクスポート」を選択し、エクスポートボタンをクリック

   <figure><img src="/files/QKGMkYTJHSeKuMhkwv1o" alt="" width="563"><figcaption></figcaption></figure>
3. エクスポートダイアログでエクスポートを実行すると、登録されているメールアドレスにデータをダウンロードするURLが届きます<br>

   <figure><img src="/files/3DvzlTW8LcQnRbAFrCax" alt="" width="563"><figcaption></figcaption></figure>

ダウンロードしたデータは、JSON形式でクラス毎に別々のファイルとして出力されます。下の内容は、エクスポートされたクラスの中身の例です。

```json
{
    "results": [
        {
            "acl": {
                "*": {
                    "read": true,
                    "write": true
                }
            },
            "createDate": {
                "__type": "Date",
                "iso": "2023-12-04T09:17:12.023Z"
            },
            "updateDate": {
                "__type": "Date",
                "iso": "2023-12-04T09:17:12.024Z"
            },
            "date": "2023/12/4",
            "item": "昼食",
            "price": "950",
            "objectId": "9JsKYvflevuq4ULZ"
        },
```

## Firestoreへのインポート

NCMBのデータストアからエクスポートしたJSON形式のデータは、Firestore Admin SDKを使用してFirestoreに登録することが可能です。

多様なプログラミング言語に対応していますが、JavaScriptを使用する場合、Node.jsでのデータ書き込みで行えます。基本的なデータ形式の移行は、下のデータ移行スクリプトをご利用ください。

{% content-ref url="/pages/ZdiYrrt9gXgkxxybJaoj" %}
[データ移行スクリプト実行手順](/migration-guide/nifcloud/datastore/data-migration-script.md)
{% endcontent-ref %}

なお、Firestoreにはデータのインポート機能も備わっていますが、下記の点に注意が必要です。

* インポート機能を使用するには、Blazeプランへの加入が必要です。
* この機能は主に、Firestoreからエクスポートしたデータを異なるプロジェクトのFirestoreにインポートするために設計されています。
