After I pushed my app and opened it to the world, something unexpected happened: Several users followed my Tweet, created an account and started playing with the application. Guess what - I tested it thoroughly but there was a bug that only happens when several users are in the system, which I didn't test locally (shame on me!).
Of course I couldn't reproduce the bug locally so I wanted to import the production data from the datastore into my local development server. This took me longer than necessary and a search on Google for this doesn't point to a simple and straightforward answer.
So here we go:
1) First add this to your app.yaml:
builtins:
- remote_api: on
2) Then update your application on appspot.com:
appcfg.py update .
3) Next download your production data:
appcfg.py download_data —application=s~appname —url=http://appname.appspot.com/_ah/remote_api/ —filename=data.csv
4) Finally import the data into your development server:
appcfg.py upload_data —filename=data.csv —url=http://localhost:8080/_ah/remote_api/ your_app_folder
Read full article from Martin Brochhaus | Importing Google App Engine datastore into your local development server
No comments:
Post a Comment