- Make sure Remote API is enabled for your project
- Make sure your Local Development Server (LDS) is running
- Login to your LDS Admin Console in your browser (by visiting http://localhost:
/_ah/login) - e.g. http://localhost:9081/_ah/login (my application is deployed on port 9081)
- Open your browser's Developer Tools (F12 in Chrome on Windows) and get the value for the dev_appserver_login cookie
- Find lib/oauth2client/oauth2client/client.py in the LDS install directory (for me this resides at C:\Program Files (x86)\Google\google_appengine\lib\oauth2client\oauth2client\client.py)
- Create a backup of this file (e.g. called client.py.bak)
- Open the original file for editing and find the "new_request" function ("def new_request")
- Before the line self.apply(headers) (for me this appears at Line 555), add the following:
- headers['Cookie'] = 'dev_appserver_login="your-cookie-value-here"';
- Save the client.py file; and restart your LDS
- Note: download_data doesn't allow specifying a query with which to download data. To limit data, filter by kind.
- Note: You can remove the --kind flag; but, that will download ALL DATA!
- Note: You can play with the --rps_limit / --batch_size flags; but, these settings worked well for me
- Open a command-line tool (e.g. MS-DOS in Windows) to your application's directory
- e.g. C:\GitHub\my_project
- Run the following command
- appcfg.py download_data --application=s~
--url=http://[APP_ID][APP_ID] .appspot.com/_ah/remote_api --rps_limit=100 --batch_size=100 --kind=[KIND] --filename=[FILENAME] .csv - e.g. appcfg.py download_data --application=s~my-project --url=http://my-project.appspot.com/_ah/remote_api --rps_limit=100 --batch_size=100 --kind=User --filename=user.csv
- Note: You can play with the --num_threads / --rps_limit / --batch_size flags; but, these settings worked well for me
- Make sure your Local Development Server (LDS) is running
- Open a command-line tool (e.g. MS-DOS in Windows) to your application's directory
- e.g. C:\GitHub\my_project
- Run the following command
- appcfg.py upload_data --application=dev~[APP_ID] --url=http://localhost:[APP_PORT]/_ah/remote_api --filename=[FILENAME].csv --num_threads=1 --rps_limit=100 --batch_size=100
- e.g. appcfg.py upload_data --application=dev~my-project --url=http://localhost:9081/_ah/remote_api --filename=user.csv --num_threads=1 --rps_limit=100 --batch_size=100
Hope this helps and thanks for reading! Make sure to share this if you liked it.