Mass Migration of Exchange 2007 to Exchange 2010 Users

My company went through a migration a few years ago of all of our users from Exchange 2003 to Exchange 2007.  The mailbox moves were insanely time-consuming.  Each mailbox has to be taken offline during the migration and that meant many, many nights of sitting up all night staring at progress bars.

Exchange 2010 handles mailbox migrations so much smoother since it doesn’t require that someone sit and stare at the screen.  Couple that with the fact that the mailboxes do not need to be offline to handle this task and the pain to the user community and the number of man-hours (or more accurately “person-hours”) drops significantly.

We have an environment where we don’t really care which Mailbox database you end up on.  Some organizations have Mailbox Databases that are configured for the Executives, another for the Professionals, and another for the Staff.  Since we don’t care, I wrote a script to just balance the databases based on size as the requirement.

Here’s the pseudo code for my script:

  1. Get a list of all the mailboxes that need to be moved
  2. Get a list of all the possible target databases
  3. Create a new variable (object) to keep track of the database information
  4. Sort the databases by size (file size less whitespace) with smallest first
  5. Sort the mailboxes by size with the largest first
  6. Create a new Mailbox Move Request to move the largest mailbox to the smallest database
  7. Increment a counter for the number of mailboxes in the database
  8. Increment the database size with the size of the mailbox being moved
  9. Remove that mailbox from the list to move
  10. Go back to step 4 and repeat until there are no more moves to create.

This is how my script looks:

Download the complete script here (Create-AllUsersMoveRequests.ps1).

There are also a few “follow-up” scripts that I’ve written.

One script checks for any moves that have failed due to failed items in the mailbox, increases the “BadItemLimit” to 10 and resubmits the move request.  If any of those fail, then the same is done, but the “BadItemLimit” is raised to 100 items.  Then I just increase by powers of 10.  I can’t imagine any mailbox that has more than 10,000 items that are all corrupt, but I’ve seen odder things.

There is also a script that runs nightly at a specified time that resumes the Suspended Moves that completed during the previous day.  There is a last one that runs just before the business day begins that clears out any completed mailbox moves.

There will be more rambling shortly about the move process.

Ramble On!

–Kevin

1 thought on “Mass Migration of Exchange 2007 to Exchange 2010 Users

  1. Hi Kevin, this is a great script, thanks for posting. Do you have the follow-up scripts posted somewhere?

    How do you take care of balancing database sizes/user numbers after you are in production? Do you have script for that as well?

    Greg

Leave a Comment