The script goal is to automate the process of migration and mailboxes balancing among target Mailbox servers.


  • The script initiates the migration by switching service plans for the provided list of subscriptions and waits until Exchange migration tasks are scheduled in Odin Automation.
  • The script balances Exchange mailboxes among target Mailbox servers listed in the Settings file (by switching the Ready to provide state of servers).
  • The script DOES NOT wait for the completion of the subscriptions migration. The script only creates the Change Order for the subscription and waits till the corresponding task is created in Odin Automation. After that, the script turns to the next subscription.
  • The script DOES NOT monitor if the capacity on the target server is completely used. Such server must be excluded from the list of target Mailbox servers in the Settings file.
  • The script helps to initiate the migration of multiple subscriptions but it may cause performance issues due to many move requests:

    • OA tasks queue will grow.
    • Tasks "Monitor move mailbox requests for service…" check statuses of all move requests. Pay attention and control the number of move requests during the migration.

Supported configurations

The following Odin Automation versions are supported:

  • poa-6.0-3517_update09-1204_KB132337
  • OA 7.4 and later

The following migration configurations are supported:

  • Exchange 2007 to 2013
  • Exchange 2010 to 2013
  • Exchange 2010 to 2016 (intra-domain/cross-forest)

DAGs are supported for all migrations.


  • Odin Automation and Billing are prepared for the migration as described in the Migrating Exchange Subscriptions by Switching Service Plans section of the Hosted Exchange guide.
  • The list of subscriptions to be migrated is ready.
  • The Settings file is filled in with the correct values specific to installation. The settings.json file shipped with script contains sample data. Do not run the script with this file.


The following parameters should be specified in the Settings file:

  • service_plans – service plans mapping. Use service plans IDs in Billing for the source_plan and target_plan paremeters. Different source plans can be mapped to the same target plan. The same source plan cannot be mapped to multiple target plans.
  • subscription_periodsID of the subscription period in Billing. Subscription periods mapping should be defined for each source plan. Different periods can be mapped to the same target period. The same source period cannot be mapped to multiple target periods. In case the service plan contains several subscription periods, you can define the mapping of all of them inside the subscription_periods section.
  • target_mbx_servers – list of target Mailbox server IDs in Odin Automation where the mailboxes will be moved. The round-robin balancing algorithm will be used to distribute mailboxes among these servers. The script will cycle through the list of servers, so that only one server has the Ready to provide state at a time, so that mailboxes from the subscription will be migrated to this server. For each subsequent subscription the script will select the next server.
  • concurrency_limit – limit of simultaneously scheduled subscription migrations. If the limit is reached, the script will not schedule the next subscription migration and the script will wait until active migration scheduling is completed. Once the limit is below the maximum value, the next subscription is scheduled for migration.
  • failures_limit – limit of allowed Change Orders failures. If the limit is reached, the script will exit. Set the -1 value if you don't want to limit failures.

Example of the settings.json file:

  "service_plans": [
      "source_plan": 1,
      "target_plan": 3,
      "subscription_periods": [
          "source": 7,
          "target": 11
          "source": 8,
          "target": 12
      "source_plan": 2,
      "target_plan": 3,
      "subscription_periods": [
          "source": 9,
          "target": 12
  "target_mbx_servers": [12, 13],
  "concurrency_limit": 20,
  "failures_limit": 100

Subscriptions list file

Prepare the list of the subscriptions to be migrated, one subscription ID per row.

Example of the subscription_list.txt file:


You can create several subscription list files including different subscription IDs and set them all as script input parameters.


  1. Upload the script archive to Odin Automation management node and extract it.
  2. Configure the settings.json file and subscriptions list file.
  3. Launch the script specifying the prepared files as input parameters.

Examples of the script launch:

python -s settings.json subscriptions.list
python -s settings.json subscriptions.list more_subscriptions.list

To track the actual migration status, see Tracking Status of Exchange Subscription Migration.


Log file is created in the same directory where the script is located. It contains the detailed information about the operations performed by the script. On each script launch, the separate log file is created with the launch date and time in the log file name.


Contact your Odin support account manager to obtain the script.

Internal content

Link on internal Article