0

I have a saas web application running on gae with multiple namespaces. We also have a staging environment on a different application_id.

Sometimes it would be very useful (for debugging) to be able to replicate production data in the staging environment, for a single namespace.

Appengine already provides an option to backup/restore the whole database (including all namespaces). That doesn't work for us. We have a lot of namespaces, so that would be too slow/expensive.

There's also a Bulk Loader that is able to dump data of a single namespace to a file. There's also a related question about it here on SO: How can I export data from Google App Engine High Replication datastore? I was think maybe there's an easy way to load one such dump file into an existing namespace? I don't know... HELP! :-)

Community
  • 1
  • 1
taciogt
  • 11
  • 1
  • Well, restore should be in the same place right? otherwise it's not called restore :P the datastore admin offers an option to copy to another app. You can copy that and then move to the desired namespace using mapreduce – marcadian May 30 '14 at 22:28
  • You're right, I didn't mean restore. Thanks. I corrected the question. – taciogt Jun 04 '14 at 16:24
  • It looks like the bulk loader can **also** be used to upload data to a database. Renzo Nucciteli wrote a blog post (in portuguese) about this: http://blog.nuccitec.com.br/2011/03/upload-e-download-de-dados-no-google.html . Also, official documentation: https://developers.google.com/appengine/docs/python/tools/uploadingdata . – Tony Lâmpada Jun 05 '14 at 13:23

1 Answers1

0

The Datastore Admin will allow to backup a single namespace. After selecting the kinds and clicking Backup Entities, the next screen allows you to specify a particular namespace.

If the backup is saved in Google Cloud Storage, you can than import that backup in a different app, which loads the metadata from the backup into the second app. Once imported, it can be restored. However, the restore will use the same namespace from the original app. The datastore admin does not perform any namespace to namespace transformations.

If you need to transform the namespace, you'll need to use your own MapReduce. You can use the code for the datastore admin itself as a starting place.

Ryan
  • 100
  • 3