Backing up and restoring your local SDK datastore (Google App Engine)

Backing up and restoring the datastore in your local SDK can be very useful for several use cases. Personally, I find that I alternate between running the local SDK with a restore of data from the deployment environment and with an empty or test datastore.

The local SDK slows down painfully when you populate it with real amounts of data so sometimes I test with an empty datastore while developing. Restoring data, however, takes a long time too so I don't want to run my restore process all the time. And I don't have to, since I can simply backup the local datastore and restore is by copying it back.

Just do a search for django_[app_name].datastore and django_[app_name].datastore.history, replacing [app_name] with the name of your app from app.yaml and then back these two files up.

You can then flush your datastore, test, and then restore the two files above when you want to work with a pre-populated datastore.

Comments