Since I have been having a number of issues with Deadlines on the M/S I would like to move to HR but creating a new app and migrating data is really not an option. Is the app engine team working on a click of a button type upgrade that doesn't require duplication and/or migrating to a new application-id etc?
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/ymI6tGec5fYJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Robert
> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/nVMNJJy440QJ.
If your entities are stored as a String, or a list of strings, you
will need to read the entities, and change their type to be either a
Key (or reference property) or a list of Keys and then perform a Put
to store them back in your datastore.
If datastore keys are stored as strings, the migration tool will not
be able to update them during the migration.
For example:
# Old model definition
class MyModel(db.Model):
links = db.StringListProperty()
# New model definition
class MyModel(db.Model):
links = db.StringListProperty()
link_keys = db.ListProperty(db.Key) # You may also want to set
indexed = False
def apply_schema_change(self):
if not links:
# There is nothing to update
return
self.link_keys = [db.Key(str_key) for str_key in self.links]
self.links = [] # We don't use this anymore, so delete the data
Then you would call the apply_schema_change method after reading the
model in from datastore, ensuring that the data is now in the new
format.
Then I would use the mapper framework to apply the new schema to all
of the entities in your datastore.
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/8_fgPFgpABAJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
--
Greg Darke
Aside from the cost factor, the migration to HR is an opportunity to
"fix" or improve your schemas. Things like long field names, unused
indexes, entity groups, etc.... All of those items that require
rewriting all of your data to adjust -- the migration is a great time
to do it. On a migration I've recently been working on, I estimate I
can reduce our storage use by about 50% with very minor changes (field
names and indexes!).
I've already migrated a couple apps, each time I've setup a job to map
over my data, maybe do some conversions, put it in some suitable
format (like csv or json) then send batches to the new app. On the
new app side I write a simple 'receiver' handler that does any needed
conversions and then writes the entities (in batches or one-by-one
transactionally, depending on the case).
Writing the sender and receiver handlers has usually been pretty quick
for me, even with very complex data. The other advantage is that you
may not need to move all of your data. Some items like stats that are
computed from your original data, may be able to be recomputed by the
exact same code as it comes in.
Would love to hear other people's thoughts on this.
Robert
Keys can also encode the namespace and any partent-child relationship
data; if those two things are not a concern then there is effectively
no difference.
Storing the ids directly is also not-bad because you will not
accidentally dereference it leading to lots of inadvertent datastore
calls. Your code will be nice and explicit.
Robert