How to restore a datastore backup to local dev server ?

834 views
Skip to first unread message

blurg

unread,
Aug 8, 2011, 2:34:56 PM8/8/11
to google-a...@googlegroups.com
Hi,

I'm trying to backup my app's data from datastore (Master/Slave Replication) to restore it on my local dev server in order to be able to fix some bugs locally.

I'm able to download datastore from my app using the following command :
appcfg.py download_data --application=XXX --url=http://XXX.appspot.com/_ah/remote_api --filename="d:\backup"
This generate a backup file which seem to be in SQLite3 format with all data inside. Perfect.

Now I'm trying to restore that backup to my local dev server. Unfortunately I can't find the proper way to do this.
I've tried two approaches:
1) using command : dev_appserver.py --datastore_path="d:\backup" "d:\XXX\src"
  which lead to the following error :
  ApplicationError: 3 Could not read data from d:\XXX\backup. Try running with the --clear_datastore flag. Cause:ValueError('insecure string pickle',)

2) using command : appcfg.py upload_data --application=XXX --url=http://localhost:8080/_ah/remote_api --filename="d:\XXX\backup"
  which lead to the following error :
  BadRequestError: app "dev~XXX" cannot access app "XXX"'s data

Can anybody help me to find me error or to point me to another approach ?

Thanks in advance.

GAEfan

unread,
Aug 8, 2011, 3:38:45 PM8/8/11
to Google App Engine
I just posted this in the thread right below this.

Try adding a dev~ (that's a tilda: ~ ) prefix to your application tag:
--application=dev~XXX

I used this successfully:

appcfg.py upload_data --url=http://localhost:8080/_ah/remote_api --
application=dev~myapp --filename=myapp_data_backup.csv --
num_threads=5

blurg

unread,
Aug 8, 2011, 3:53:42 PM8/8/11
to google-a...@googlegroups.com
Working perfectly. Thanks a lot GAEfan !

Chris

unread,
Sep 6, 2011, 10:29:57 PM9/6/11
to Google App Engine
Same issue. Great post for the work around. Thanks GAEfan!
Reply all
Reply to author
Forward
0 new messages