# Migrating Applications - Google App Engine - Google Code

English ▼
Skip to page content Skip to main navigation
e.g. "templates" or "datastore"

# Migrating Applications

You can migrate your app from a Master/Slave to an app that uses High Replication Datastore using the migration tools found in the Application Settings tab of the Administration Console.

- Migrate from Master/Slave to High Replication Datastore

## Migrate from Master/Slave to High Replication Datastore

You may need to make some changes to your app to ensure an optimal migration from a Master/Slave app to an app that uses HRD. For more information, see the following:

- Choosing a Datastore
- Using the High Replication Datastore
- Transaction Isolation

You must make a new copy of that app, deploy the new app, and copy data from your old app to the new deployed copy. You do not incur any billing costs when you do this migration.

Here is the overall process:

1. Create a new copy of your app with a new application ID. You can do this either manually, or you can use the Duplicate Application Settings feature in the Application Settings tab of the Administration Console. Set all properties for the new app to match your settings for the Master/Slave app, except, of course, for the datastore: the new app must use HRD.
2. Deploy the new copy of your app.

   Note: Deploy your HRD application before copying data to it. If you start copying data before deploying your application, all of the indexes must be rebuilt.

3. Copy data from your original app's Master/Slave Datastore to HRD using the Migration Tool inside the admin console's Application Settings. This iterative process is described in Using the Migration Tool.
4. If your app has Blobstore data, migrate it as described in "Migrating Blobstore Data".

### Duplicating Your App

Note: These instructions use the Duplicate Application Settings feature inside the Application Settings tab of the admin console to copy an app where the copy will use HRD. You could manually accomplish the same thing using other capabilities of the admin console if you wish, but the method described here is the fastest, easiest way to duplicate your app.

To make a copy of your existing app,

1. Open the admin console, select the app you want to copy, and go to Application Settings.
2. In the New Application Identifier text box, notice that your current application's application ID is shown with the `-hrd` suffix. You can use this or provide an entirely new application ID if you wish.
3. Click Check Availability to verify that the application ID you've chosen is available. Change the ID if necessary.
4. Click Duplicate Application.
5. Only the App Title and access control settings are copied during this copy process. You must manually set any other features needed for the new app, such as the following:
   - Billing
   - Quota
   - Cron configuration
   - Taskqueue configuration
   - Backend configuration. Remember to start up the backends in the new app_id and shut down backends in the old app to avoid incurring unnecessary cost.
   - Any other desired settings or configurations
6. When you finish changing your application settings, deploy this app, following the instructions provided for the appcfg tool.

### Using the Migration Tool

Note: The use of this tool requires you to first complete the process described in Duplicate Application Settings.

The HRD migration tool can migrate your app while your app continues to serve requests and write data to the Master/Slave Datastore. Requests coming in to your app continue to be served by the current app using Master/Slave during this process, until the copy process is finished and you are ready to switch over to the HRD app. There may be a brief period of time during the switchover when your application may not be able to serve write requests.

Here is the overall process:

- The first time you run this tool (using Start Migration), the tool copies all existing data in your Master/Slave Datastore to the datastore used by the deployed "HRD version" of your app, and marks any new or changed data after this copy so that further (incremental) copies can be made to copy that new or changed data into the datastore.
- Run Launch Incremental Copy to capture only the new or updated data marked in the datastore. This run of this tool will be faster than the first.
- You may need to repeat Launch Incremental Copy) once or twice if your app has a large number of data writes. The idea is to make the time between incremental copies as short as possible before going read-only.
- When finished with the last incremental copy, click Go read-only. No more data can be written to the Master/Slave application after you do this.
- Immediately after the final incremental copy is made, alias the application over to the HRD app (by clicking Complete migration. The new HRD app begins serving incoming requests when you do this.

The HRD migration tool provides a status monitor indicating progress, and a time estimate. In addition, you can request an email to be sent to you when the migration tool finishes the current run.

#### Running the Migration Tool

Note: Deploy your HRD application before copying data to it. If you start copying data before deploying your application, all of the indexes must be rebuilt.

To run a migration,

1. Open the admin console, select the app you want to migrate, and select Application Settings>View Migration Tool.
2. In the Destination Application dropdown, select the new HRD application to which you migrating the data.
3. Click Start Migration, and wait until the data is migrated over to HRD. Click the email checkbox shown in the screen capture above if you wish to be emailed when the job is done. (The HRD migration tool also provides a time estimate and a status monitor.)
4. If your Master/Slave app continues to serve requests during the migration,
   1. Click Launch Incremental Copy and wait for it to finish.
   2. After you run the incremental copy, if your application is writing significant amounts of data, run the incremental copy again. You may need to run Launch Incremental Copy once or twice.
5. When the data copy phase is complete, click Go Read-Only. This stops the original Master/Slave app from writing new data to the datastore, although it can serve read-only requests. The Go read-only step performs one final sync while the app is read-only.
6. Click Complete migration to alias the app over to the HRD app. At this point, the new HRD app begins serving incoming requests.