Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6641819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:51:21+00:00 2026-05-25T23:51:21+00:00

When upgrading a GAE application, what is the best way to upgrade the data

  • 0

When upgrading a GAE application, what is the best way to upgrade the data model?

The version number of the application allows to separate multiple versions, but these application versions use the same data store (according to How to change application after deployed into Google App Engine?). So what happens when I upload a version of the application with a different data model (I’m thinking python here, but the question should also be valid for Java)? I guess it shouldn’t be a problem if the changes add a nullable field and some new classes, so the existing model can be extended without harm. But what in case the data model changes are more profound? Do I actually lose the existing data if it becomes inconsistent with the new data model?

The only option I see for the moment are putting the data store into maintenance read-only mode, transforming the data offline and deploying the whole again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:51:22+00:00Added an answer on May 25, 2026 at 11:51 pm

    There are few ways of dealing with that and they are not mutually exclusive:

    • Make a non-breaking changes to your datastore and work around the issues it creates. Inserting new fields into existing model classes, switching fields from required to optional, adding new models, etc. – these won’t break compatibility with any existing entities. But since those entities do not magically change to conform to new model (remember, datastore is a schema-less DB), you might need a legacy code that will partially support the old model.
      For example, if you have added a new field, you will want to access it via getattr(entity, "field_name", default_value) rather than entity.field_name so that it doesn’t result in AttributeError for old entities.
    • Gradually convert the entities to new format. This is quite simple: if you find an entity that still uses the old model, make appropriate changes. In the example above, you would want to put the entity back with new field being added:

      if not hasattr(entity, "field_name"):
          entity.field_name = default_value
          entity.put()
      val = entity.field_name # no getattr'ing needed now
      

      Ideally, all your entities will be eventually processed in such manner and you will be able to remove the converting code at some point. In reality, there will always be some leftovers which should be converted manually — and this bring us to option number three…

    • Batch-convert your entities to new format. The complexity of logistics behind this depends greatly on the number of entities to process, your site’s activity, resources you can devote to the process, etc. Just note that using straightforward MapReduce may not be the best idea – especially if you used the gradual convert technique described above. This is because MapReduce processes all entities of given kind (fetching them) while there may only be a tiny percentage needing that. Hence it could be beneficial to code the conversion code by hand, writing the query for old entities explicitly and e.g. using a library such as ndb.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GAE application. A new request is to have a huge database
after upgrading to latest version of eclipse Helios 3.6 , M2E 1.0 , WTP
After upgrading Leiningen (from v1.6 to v1.7) with lein upgrade command lein swank stopped
Before upgrading to version Mono 2.10.9, XCode 4.2 and Monotouch 5.2.11 I used to
While upgrading a Windows Forms application from the .NET 1.1 framework to the .NET
After upgrading to the latest version of TortoiseSVN (1.5.2.13595), it's context menu is no
I am creating XML files in my GAE web application and I would like
I can't upload data to my GAE Java dev serwer. Bulkloader asks for a
After upgrading to xcode 4.2.1 on lion, I tried to do NSLog(@testing...); but it's
Im upgrading my app to rails31 .. everything works quite ok but i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.