Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How use AppEngine's Datastore Admin: Copy to Another App Feature

I recently enabled AppEngine's Datastore Admin. I do not understand the instructions on how to copy my data to another app.

Note: The target application must enable remote_api and must include this application’s ID in its HTTP_X_APPENGINE_INBOUND_APPID list.

WARNING This application’s data is writable. We can only guarantee a consistent copy when the data being copied is read-only. Note: Blobs (binary data) will not be copied.

To enable the remote_api I included the following in the app.yaml:

 builtins:
    - remote_api: on

I have no idea what HTTP_X_APPENGINE_INBOUND_APPID is, and a Google search yields no results....any ideas? alt textalt text

like image 444
Nick Siderakis Avatar asked Dec 17 '10 05:12

Nick Siderakis


2 Answers

The datastore copy feature is currently available only for Python applications.

If you are using GAE for Java you must do the following steps:

Notes: Assuming you are copying from app example1.appspot.com to app example2.appspot.com and your Java WEB-INF app folder is located in /Users/admin/src/main/webapp/WEB-INF

  1. Download Python SDK https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
  2. Run the Python SDK
  3. Create a new file inside your WEB-INF folder: app.yaml
  4. Create a new file inside your WEB-INF folder: appengine_config.py
  5. Deploy your new version (run in terminal): appcfg.py -A example2 update **/Users/admin/src/main/webapp/WEB-INF
  6. Go to your example1 datastore admin view and put: datastore-admin.example2.appspot.com/_ah/remote_api

app.yaml:

application: example2
version: datastore-admin
runtime: python
api_version: 1


builtins:
- remote_api: on
- datastore_admin: on

appengine_config.py:

remoteapi_CUSTOM_ENVIRONMENT_AUTHENTICATION = (
    'HTTP_X_APPENGINE_INBOUND_APPID', ['example1'])
like image 170
Tiago Fernandes Avatar answered Nov 05 '22 07:11

Tiago Fernandes


If you are using java and already tried this and its not working(i had the same problem) i added:

<servlet>
    <display-name>Remote API Servlet</display-name>
    <servlet-name>RemoteApiServlet</servlet-name>
    <servletclass>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>RemoteApiServlet</servlet-name>
    <url-pattern>/remote_api</url-pattern>
</servlet-mapping>

in web.xml and update with this command: appcfg.py -A appid update /yourappfolder/war/WEB-INF

Strange but after i did that it worked.

like image 2
Alex91 Avatar answered Nov 05 '22 09:11

Alex91