Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 845
yalestar Avatar asked Jan 24 '23 16:01

yalestar


1 Answers

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.

like image 76
Nick Johnson Avatar answered Jan 30 '23 01:01

Nick Johnson