| ★ wanayoo — archive 1999 https://developers.google.com/appengine/docs/adminconsole/datastoreadmin | Nouvelle recherche | Portail wanayoo |
Datastore Administration is an experimental, innovative, and rapidly changing new feature for Google App Engine. Unfortunately, being on the bleeding edge means that we may make backwards-incompatible changes to Datastore Administration. We will inform the community when this feature is no longer experimental.
You can use the Datastore Admin tab of the Admin Console to
Important! In order to use these Datastore Admin features for your app, you must first enable datastore_admin in your app.
In order to use the features of the Datastore Admin tab, you must enable datastore_admin for your application using the Applications Settings page of the Administration Console. Under the Built-Ins heading, click Enable next to Datastore Admin:
Warning! Backup, restore, copy, and delete occur within your application, and thus count against your quota.
Note: Blob data is not backed up by this backup feature!
You can use the Datastore Admin tab of the Admin Console to backup entities of selected kinds and when needed restore from a selected backup, with the backup/restore affecting all namespaces. This feature is intended to help you recover from accidental deletes of data. When you restore from a backup, any new entities added since the backup are retained, and entities that existed at backup-time and that were modified after the backup are overwritten with values from the backup. You can restore all data from a backup or you can restore specific entity kinds from the backup.
You can use either Blobstore or Google Cloud Storage as the location where backups are stored, as described in the instructions below. If you choose the Google Cloud Storage option, you must specify a bucket that you have set up with write permissions for your app.To backup your data,
Make sure the specified bucket is configured with write permissions for your application. The backup will not be able to complete unless your app has write permissions for that bucket. In this case, the backup will keep repeating the attempt to back up the data, giving you an opportunity to remedy the situation by enabling write permissions on the bucket for your app.
If Backup jobs are currently running, they appear in a Pending Backups list in the Datastore Admin screen. You can stop these running backups by selecting the backup in the list and clicking Abort. When you abort a backup job, App Engine attempts to delete backup data that has been saved up to that point. However, in some cases, some files may remain after the abort. You can locate these files in the location you chose for your backups (blobstore or Google Cloud Storage) and safely delete them after the abort completes. The names of such files will start with the following pattern: datastore_backup_your_backup_name.
Note: Currently, if you abort or delete a backup, App Engine does not delete files from Google Cloud Storage. You must manually delete backup files from Google Cloud Storage.
You may want to find out details about a backup, such as which entity kinds it contains, where it was saved (e.g., blobstore or Google Cloud Storage), and its starting and ending time. To display this backup information,
You can run scheduled backups using the App Engine Cron service. For details, see Scheduled Backups.
To restore from a backup,
Important: The Datastore Admin copy feature is available only for Python apps. If you have a Java application, see A Note for Java Developers. You must also enable datastore_admin.
You can use the Datastore Admin tab of the Admin Console to copy all entities of a kind, or all entities of all kinds, to another application. The datastore copy functionality uses the Datastore Admin screen in the Data section of the source application's Admin Console. From the Datastore Admin screen, you can select and copy entity kind(s) with the click of a button:
The datastore copy feature is currently available only for Python applications. If your target app is built in Java, you'll need to create a non-default Python runtime for it and use that as the target application. The following steps describe how to create a non-default Python runtime for your target application using a sample application called datastore_admin:
appcfg.py -A <your_app_id> update <directory-of-demo-app>If you used the demo app described in A Note for Java Developers, you can skip steps 1–3.
To copy a datastore,
remote_api builtin for the target application so it can receive data from the source. To do this, add the following to app.yaml:
builtins: - remote_api: on
appengine_config.py file in the root directory of your application:
remoteapi_CUSTOM_ENVIRONMENT_AUTHENTICATION = ('HTTP_X_APPENGINE_INBOUND_APPID', ['source appid here'])
If you do not have a appengine_config.py file, you can create a new one or copy the sample located in google/appengine/ext/appstats/sample_appengine_config.py.appcfg.py update. Although this step is not required, it is strongly recommended. Copying entities into a new datastore takes time and writes done during the copy might not be transferred during the copy. If the source application is not in read-only mode, you can still copy data, but you'll see a notreadonly warning in the Admin Console. The destination datastore is not guaranteed to receive a complete copy of the new data unless writes are disabled.
http://your_target_app_id.appspot.com/_ah/remote_api.http://datastore-admin.your_target_app_id.appspot.com/_ah/remote_api.http://app_version.your_target_app_id.appspot.com/_ah/remote_api.After you confirm, the system validates the request. If the remote_api connection can be established, one or more mapreduce operations begins to copy the data. You can follow the link to see the status of the initial set of mapreduce operations. If the application uses the namespace feature, a mapreduce runs for each namespace for each entity kind.
You can view a summary of the copy status from the Datastore Admin page. To view the individual mapreduce status, you can visit http://your_target_app_id.appspot.com/_ah/mapreduce/
You can use the Datastore Admin tab of the Admin Console to delete all entities of a kind, or all entities of all kinds, in all namespaces. To enable this feature, simply enable Datastore Admin for your application in the Administration Console.
Adding this builtin enables the Datastore Admin screen in the Data section of the Administration Console. From this screen, you can select the entity kind(s) to delete individually or in bulk, and delete them using the Delete Entities button.