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 7645709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:00:37+00:00 2026-05-31T10:00:37+00:00

in order to migrate our application (2 years old, fair amount of data), I

  • 0

in order to migrate our application (2 years old, fair amount of data), I plan to use the recommended tool.

Some of our entities store serialized dictionaries with references to keys, so we’ll need to convert those to change the application name part of the key. My question is, will changing data that has been migrated mess up the migration tool’s understanding of what needs to be migrated during an incremental copy? E.g, is it safe to:

  • Start the migration tool
  • run our custom tool to migrate stored keys (in the new app)
  • verify our app works
  • run an incremental copy
  • run our tool 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-31T10:00:38+00:00Added an answer on May 31, 2026 at 10:00 am

    It turns out that during the migration, the target app is in read only mode, so running any repair tools on the target hrd app before the migration is complete is not an option.

    Instead, my approach is now to monkey patch db.get to rewrite keys on the fly, and then repair the references in the target app post migration. So far I’ve verified my new hrd app works fine with the monkey patch in place. It makes me wary to have to fix the references once the new version is live, but so it goes.

    from google.appengine.ext import db
    import os
    
    APP_ID = os.getenv('APPLICATION_ID')
    
    def replace_key(key_str, app_id=None):
        app_id = app_id or APP_ID
        oldkey = db.Key(key_str) if not isinstance(key_str, db.Key) else key_str
        if oldkey.app() != app_id:
            fixedkey = str(db.Key.from_path(oldkey.kind(), oldkey.id_or_name(), _app=app_id))
            logging.info("rewriting %s to %s", str(oldkey), fixedkey)
            return fixedkey
        else:
            return key_str
    
    old_get = db.get
    
    def monkeyed_get(keys, **kwargs):
        single = False
        if isinstance(keys, (basestring, db.Model, db.Key)):
            single = True
            keys = [keys]
    
        results = old_get(map(lambda k: replace_key(str(k)), keys), **kwargs)
        return results[0] if single else results
    
    db.get = monkeyed_get
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in order to recover data from server I use XMLHttpRequest and my code is
In order to migrate smoothly a Rails 3.0.10 application which need to grow up
We try to migrate our old server to a new one but we experienced
in order to avoid copy/paste, i can use a unique view for different actions,
In order to set some varaibles i need the information if a given file
In order to help out one of our departments here I've cloned a machine
I have been asked to migrate a schema from our testing area into our
I'm developing the Order Model for a Rails application.I'm trying to represent an Order
I'm trying to migrate an existing application from IIS with ServletExec to tomcat. I
When changing the password-hashing algorithm for an application, how should the system migrate the

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.