Home‎ > ‎Server‎ > ‎App Engine‎ > ‎

Backup


Blobs or Google Storage Backup

https://github.com/branflake2267/AppEngineUtils - Github project to backup to blobs or Google Storage


Command Line Backup Utility

https://github.com/branflake2267/AppEngineDts - I use this to backup to my server


Copy Remote Entities to Local Dev Datastore

This can copy remote entity to local dev local_db.bin datastore.  This is handy for debugging your production data in your dev environment.

  private void putEntity(DatastoreService localDataStore, Entity remoteEntity) {
   
EntityProto proto = EntityTranslator.convertToPb(remoteEntity);
   
   
// This is key to copying the entity!
   
Reference x = proto.getKey();
    x
.setApp(appKey);
    proto
.setKey(x);
   
   
Entity localEntity = EntityTranslator.createFromPb(proto);
   
   
Transaction txn = localDataStore.beginTransaction();
   
try {
      localDataStore
.put(txn, localEntity);
      txn
.commit();
   
} catch (Exception e) {
      e
.printStackTrace();
   
}
   
    log
.info("putEntity() localEntity=" + localEntity);
   
System.out.println("putEntity() localEntity=" + localEntity);
 
}


Notes

I don't save the types and would compose those on restore deriving on whats in the db already. What matters is I can search the text. You can use the EntityTranslator to serialize the Entity exactly as you need to restore it. 

Comments