[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThe Cloud Datastore Emulator provides a local emulation of the production Datastore environment and is progressively becoming the default Datastore implementation for dev_appserver.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to the Datastore Emulator allows for shared data between App Engine standard environment client libraries and Cloud Datastore Client Libraries, enabling data sharing between services running on App Engine standard and flexible environments.\u003c/p\u003e\n"],["\u003cp\u003eTo use the Cloud Datastore Emulator, users must have Java runtime (JRE) version 11 or above installed and can force its use by setting the \u003ccode\u003e--support_datastore_emulator\u003c/code\u003e flag to true when starting \u003ccode\u003edev_appserver.py\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edev_appserver\u003c/code\u003e tool uses the \u003ccode\u003eDATASTORE_EMULATOR_HOST\u003c/code\u003e environment variable to determine whether to launch a new emulator process or communicate with an existing one, and data is stored as Java objects, converting from legacy sqlite3 format upon launch.\u003c/p\u003e\n"],["\u003cp\u003eFor issues with gRPC imports, you can install gRPC separately using pip with gcloud CLI 219.0.0 or higher via the command \u003ccode\u003epip install grpcio\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Migrating to the Cloud Datastore Emulator\n\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** This migration requires the use of the [Google Cloud CLI](/appengine/docs/legacy/standard/python/download).\n\n[Cloud Datastore Emulator](/datastore/docs/tools/datastore-emulator)\nprovides local emulation of the production Datastore environment. Cloud Datastore\nEmulator is progressively being rolled out as the default Datastore\nimplementation for dev_appserver.\n\nBenefits of migrating to Datastore Emulator\n-------------------------------------------\n\nThe Datastore Emulator can be shared between App Engine standard\nenvironment client libraries such as DB and\n[NDB](/appengine/docs/legacy/standard/python/ndb), and the\n[Cloud Datastore Client Libraries](/datastore/docs/reference/libraries).\n\nYou can use the Datastore Emulator to share local data between services running\non App Engine standard environment and App Engine flexible\nenvironment.\n\nBefore you start\n----------------\n\n1. Download and install the Java runtime (JRE) version 11 or above.\n\n2. Run dev_appserver from the `google-cloud-sdk/bin` directory.\n\nChoosing your emulation environment\n-----------------------------------\n\nThe Cloud Datastore Emulator is the default emulator for a portion of\ndev_appserver users. If you are using the Cloud Datastore Emulator,\ndev_appserver will display: \n\n ... Using Cloud Datastore Emulator.\n\nYou can force dev_appserver to use the Cloud Datastore emulator by setting the\n`--support_datastore_emulator` flag to true when starting `dev_appserver.py`:\n| **Important:**\n| - Before running the local development server, follow the [setup instructions](/appengine/docs/legacy/standard/python/tools/using-local-server#set-up). Regardless of your app's runtime or language version, you must run `dev_appserver.py` with Python 3 and set the `CLOUDSDK_DEVAPPSERVER_PYTHON` environment variable in your shell to the path of your Python 2 interpreter.\n- The `dev_appserver` tool does not support development of Python 3 apps on Windows. \n\n python2 \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eDEVAPPSERVER_ROOT\u003c/span\u003e\u003c/var\u003e/google_appengine/dev_appserver.py --support_datastore_emulator=[true|false] app.yaml\n\nReplace \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e with the path to the folder where you\nextract the archived version of `devapp_server.py`. For more information about\ndownloading and using the archived version of `dev_appserver.py`, see [Using the local development server](/appengine/docs/legacy/standard/python/tools/using-local-server#before_you_begin).\n\nUsing dev_appserver with the Datastore Emulator\n-----------------------------------------------\n\nDev_appserver decides whether to launch the emulator based on the environment\nvariable `DATASTORE_EMULATOR_HOST`.\n\n- When this environment variable exists, dev_appserver communicates to an\n existing emulator process running on `DATASTORE_EMULATOR_HOST`.\n\n- When this environment variable does not exist, dev_appserver launches a new\n emulator process. You can specify the port for the Datastore Emulator by\n setting the `--datastore_emulator_port` when starting dev_appserver.py.\n\nBehavior changes\n----------------\n\n### Local data format conversion\n\nCurrently, the local Datastore emulator stores data in sqlite3 while the\nCloud Datastore Emulator stores data as Java objects.\n\nWhen dev_appserver is launched with legacy sqlite3 data, the data will be\nconverted to Java objects. The original data is backed up with the filename\n{original-data-filename}.sqlitestub.\n\n### Local data file location\n\nThe local data file can be specified with the flag `--datastore_path`.\n\n- When dev_appserver launches the emulator, the location remain unchanged.\n\n- When dev_appserver uses existing Cloud Datastore Emulator, this flag\n will be ignored in favor of the emulator's setting.\n\n### Local index.yaml\n\n- An empty index.yaml will be considered as invalid. The\n [syntax](/appengine/docs/legacy/standard/python/config/indexref#syntax) of index.yaml\n is the YAML format. The index.yaml file has a single list element called indexes.\n\n- When dev_appsever launches the emulator, index.yaml will stay in the\n application project directory.\n\n- When dev_appserver uses existing Cloud Datastore Emulator, index.yaml will\n be managed by that emulator.\n\nOther [features for the local datastore server](/appengine/docs/legacy/standard/python/tools/using-local-server#using_the_local_datastore)\nremain unchanged.\n\nTroubleshooting\n---------------\n\n### Getting emulator output\n\nBy default dev_appserver runs Datastore Emulator in silent mode. To see the\noutput of Datastore Emulator, run dev_appserver with\n`--dev_appserver_log_level=debug`.\n\n### Failing gRPC imports\n\nThe dev_appserver uses [gRPC](https://pypi.org/project/grpcio/) to communicate\nto the Cloud Datastore Emulator. gcloud CLI packages gRPC, however the\npackaged version is incompatible with some operating systems, causing import\nfailures.\n\nTo fix import failures, you can install gRPC separately using `pip` with\ngcloud CLI 219.0.0 or higher: \n\n pip install grpcio"]]