简体   繁体   中英

Google AppEngine/Java and existing DB

Is there a way to upload database contents to Google App Engine for Java, like the bulk uploader script in the Python version? If not, how would you get existing data into your GAE/J app?

You can use the Python uploaders to upload data for your Java app. First, create an app.yaml in an empty directory that contains the following:

application: yourappid
version: upload
runtime: python
api_version: 1
handlers:
    - url: /remote_api
      script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
      login: admin

Then, use 'appcfg.py update .' in that directory. Now you can use the 'bulkloader.py' bulk load tool, pointing it at upload.latest.yourappid.appspot.com. Since multiple major versions can run simultaneously, and all versions of an app share the same datastore, you can use the Python bulk uploader while still running your app in Java.

As far as I know, the only two options available are:

  1. Bulkload.py
  2. GAEBAR

As you have noted, both are python oriented. I have not seen a similar equivalent for GAE/J.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM