Backup GAE Datastore

Do I need to back up my GAE data warehouse?
Does anyone have experience, suggestions, tricks for this?

+7
google-app-engine backup google-cloud-datastore
source share
2 answers

Now you can use the managed export and import function, which can be accessed through gcloud or the Datastore Admin API:

Export and import of objects

Export planning

+1
source share

Backups are always necessary to protect against human error. Since App Engine recommends that you create multiple versions of code that work with the same data set, it is important to be able to return.

A simple dump / restore tool is explained in the Bulkloader Documentation .

Something else that I did in the past for the main DB repositories:

  • Change the name of the object in the new code (for example, User → Client or User2, if you need)
  • When searching for an object by key:
    • Try the key and return if possible
    • Try the key for the old db.Model class. If you find it, transfer the data, put () and return the new object
  • Use object as usual

(You may need to use the task queue to transfer all data. If you always retrieve entities by key, this is optional.)

Deploy a new version of your code so that both coexist on the server side. When you activate the new version, it looks like a snapshot of old objects. In an emergency, you can reactivate the old version and use the old data.

+6
source share

All Articles