Sunday 17 August 2014

Exchange 2007 to Exchange 2013 SP1: Get-MoveRequest script StatusDetail "FailedStuck" progress halted

Warning - this may not work for you if your move request is in the 90% complete region. I noticed when a move request get to between 95-99% the status changes to CleanUp which I can only imagine it means it's deleting the original mailbox from Exchange 2007. Therefore I would be careful if you are this far into a mailbox move before you try this

I was migrating mailboxes from Exchange 2007 to 2013, and over night the batch job ran into an issue that changed some of the mailbox statuses to FailedStuck, this was effectively stopping the migration. I used the following command to check the progress;
Get-Content C:\ListofUsers.txt | Get-MoveRequestStatistics

It was concerning to see a number of the mailboxes status was FailedStuck

I decided to cancel and then restart a move request to see if that would resolve the issue;
Remove-MoveRequest –Identity “username”



Then when I run the Get-MoveRequestStatistics command again, it could not find a move request job for that user. Therefore it had effectively cancelled the job.
Get-Content C:\ListofUsers.txt | Get-MoveRequestStatistics


I then restarted the move request manually using
New-MoveRequest –Identity “username” –TargetDatabase “db name”


Now if I run the Get-MoveRequestStatistics again, it has restarted the job and the StatusDetail has changed to CopyingMessages.

Since the testing on a single mailbox resolved the issue and got the migration going again I decided to cancel all of the FailedStuck job, I did this using the following command;
Get-Content C:\FailedUsers.txt | Remove-MoveRequest

I could off course used the -Confirm:$false switch to automate these prompts but I wanted to ensure all of the failed users started again.

Once I have run through and cancelled all of the job, I run the Get-MoveRequestStatistics again to ensure all the move request had actually been cancelled.

The next stage was to restart the move requests from scratch, I did this by copying the list of failed users text file and using the following command;
Get-Content C:\FailedUsers.txt | New-MoveRequest –TargetDatabase “db name”