How to: Move Mailboxes to another Exchange Server 2013

How to: Move Mailboxes to another Exchange Server 2013

So again, another fun day thanks to the folks at Microsoft (or my karma… I am really debating on that one). For some reason my CAS server stopped working properly and after spending a whole day trying to figure out why I can’t log back in I decided to follow some advice in Technet that pretty much reads like this “Reinstall your CAS server”… Great! It also turns out that you cannot simply repair your CAS server or uninstall your CAS server, you have to uninstall the whole Exchange installation on your server (lucky if you have a separate CAS server). So… here I am installing a new Exchange server so I can uninstall the previous one so I can reinstall the CAS server.

So my first recommendation: Backup. My second one, install a target Exchange Server to migrate over your mailboxes.

When you try to uninstall your Exchange Server you will get the following error message:

Error:
Uninstall can’t continue. Database Mailbox Database TP : This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database . To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database  -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database  -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database  -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox . To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox  -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox  -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest . If this is the last server in the organization, run the command Disable-Mailbox  -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan -Database . It was running the command ‘Remove-MailboxDatabase ‘CN=Mailbox Database TP,CN=Databases,CN=Exchange Administrative Group (),CN=Administrative Groups,CN=Company Name,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DomainNAme,DC=local’ -whatif’.
For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.UnwillingToRemoveMailboxDatabase.aspx

So at this point the guidance is clear: Transfer your data out or risk losing it.

In order to transfer our mailboxes you need to define your topology and strategy: If you are spreading them to different servers, etc. In this example we are simply moving everything from one server on to the next with the following command:

Get-Mailbox | New-MoveRequest –TargetDatabase “Mailbox Database Temp”

Get-Mailbox -Arbitration | New-MoveRequest –TargetDatabase “Mailbox Database Temp”

Get-Mailbox -PublicFolder | New-MoveRequest –TargetDatabase “Mailbox Database Temp”

(or)

Get-Mailbox -Database “Mailbox Database SOURCE” | New-MoveRequest -TargetDatabase “Mailbox Database DESTINATION

That way it creates a move request for every mailbox we have on the enterprise, which is extremely convenient when you are a small business but if not use the right parameters that fit your needs with the Get-Mailbox command so you only transfer what you want.

Now that you have started the transfer, you can continue to monitor the progress of it using the Get-MoveRequestStatistics like in the example below:

Get-MoveRequestStatistics -MoveRequestQueue “Mailbox Database Temp”

You can also check the status of a particular mailbox using that command with the following parameters:

Get-MoveRequestStatistics -Identity “DomainUser” | Format-List

(or if you want a report to go with it)

Get-MoveRequestStatistics -Identity [email protected] -IncludeReport | Export-CSV C:MR-Report.csv

Something you need to keep in mind is that when you execute Get-MoveRequest you get basic information and only Get-MoveRequestStatistics gives you additional information like Percent Complete. Keep in mind you need to provide an Identity like so:

Get-MailboxRequestStatistics -Identity "BauzasCarlos"

It is even possible for you to obtain more details and information using the -IncludeReport parameter:

Get-MailboxRequestStatistics -Identity UserName -IncludeReport | Format-List

or if you want to be more practical, you can generate an exhaustive report of all failed restore requests:

Get-MailboxRestoreRequest -Status Failed | Get-MailboxRestoreRequestStatistics -IncludeReport | Format-List > AllFailedRestoreReports.txt

Another important thing to keep in mind is that Move requests the same way as Export requests remain in the system until manually removed. I believe this is only for historical purposes, once the job is completed you can leave those there, but, if you try to move those mailboxes again to another server you won’t be able to schedule the move request and you’ll get the following error:

Mailbox ‘Bill Gates’ has a completed move request associated with it. Before you create a new move request
for the mailbox, run the Remove-MoveRequest cmdlet to clear the completed move request.
+ CategoryInfo : InvalidArgument: (Contoso.com/Usuarios del Dominio/B.Gates:MailboxOrMailUserIdParameter) [N
ew-MoveRequest], ManagementObjectAlreadyExistsException
+ FullyQualifiedErrorId : 19053721,Microsoft.Exchange.Management.RecipientTasks.NewMoveRequest
+ PSComputerName : Exchange.Contoso.com

so, in order to resolve this do as it indicates above. I would suggest the following command that might take care of all your completed requests:

Get-MoveRequest | where {$_.status -eq “Completed”} | Remove-MoveRequest

 

Enhanced by Zemanta

You may also like...

1 Response

  1. Eric Chiu says:

    Simply move Exchange server mailbox to new server. May this blog helpful for Exchange server users.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.