Demystifying the Mailbox Replication Service

Recently I was given the task to assist a customer experiencing issues with their migration to Exchange Online leveraging Exchange Hybrid migration practices.  One of the biggest challenges sys-admins experience today is understanding the complexities of mailbox migration to Exchange Online.  The most frequent questions are; What happens when New-MoveRequest fails?  Where do we start troubleshooting?

Before we start taking things apart, and parsing through endless logs, we need to understand the inner workings of the Mailbox Replication Service in Exchange.

What is MRS?  The Microsoft Exchange Mailbox Replication Service (MRS) is a feature that handles mailbox move requests for Exchange.  The Microsoft Exchange Mailbox Replication Service primary logic is to move a mailbox from a source database (on-premise or Exchange Online) to a destination database (on-premise or Exchange Online).  This is a watered-down explanation and does not give MRS the justice it deserves since it's a very deep topic and requires great detail.  All we need to know for this blog is "MRS is your friend when moving mailboxes around."

The journey of the mailbox begins with executing New-MoveRequest.   Executing this cmdlet starts the process of an asynchronous mailbox or personal archive move.

For a deeper look, I copied some logs from a production migration to share the process of MRS.  To achieve this in your lab, execute Get-MigrationUserStatistics which will return information about the request process.

Get-MigrationUserStatistics -Identity dsoto@corp.365pro.net -IncludeReport | Format-List Status,E

A key component to successful MRS troubleshooting is to understand migration sync stages.  The chart below specifies the sync stages. It can be one of the following:

Sync Stage Cleanup
CopyingMessages
CreatingFolderHierarchy
CreatingInitialSyncCheckpoint
CreatingMailbox
Error
FinalIncrementalSync
IncrementalSync
LoadingMessages
MailboxCreated
None
SyncFinished

The Get-MoveRequestStatistics should be in your back pocket in the event your in need of some deep technical troubleshooting material.

In this first-line we can see the move request initiating the process of the fetching the mailbox store of the mailbox.

7/2/2019 4:00:05 PM [DATABASE] Request processing started.

Once we've located the source mailbox, the service will gather the source mailbox information.

7/2/2019 4:00:06 PM [DATABASE] Source mailbox information:

Regular Items: 39378, 4.453 GB (4,781,077,675 bytes)

Regular Deleted Items: 12924, 1.077 GB (1,156,657,512 bytes)

FAI Items: 239, 4.455 MB (4,670,889 bytes)

FAI Deleted Items: 0, 0 B (0 bytes)

An orphaned mailbox is a mailbox that exists in Microsoft Exchange but does not have an Active Directory user associated with it.  The MRS will evaluate the object prior to the migration and confirm it has its corresponding AD user object.

7/2/2019 4:00:06 PM [DATABASE] Cleared sync state for request [MAILBOX GUID] due to 'CleanupOrphanedMailbox'.

7/2/2019 4:00:06 PM [DATABASE] Mailbox signature will not be preserved for mailbox '365pro.onmicrosoft.com\[MAILBOX GUID] (Primary)'. Outlook clients will need to restart to access the moved mailbox.

At this point, we have connected the source to the target, retrieve the mailbox information, and validated an the mail user objects is present.

7/2/2019 4:00:09 PM [DATABASE]  Percent complete: 10.

Now the folder hierarchy is initialized and the MRS begins building the folder structure:

7/2/2019 4:00:10 PM [DATABASE] Initializing folder hierarchy from mailbox '365pro.onmicrosoft.com\[MAILBOX GUID] (Primary)': 127 folders total.

7/2/2019 4:01:39 PM [DATABASE] Folder hierarchy initialized for mailbox '365pro.onmicrosoft.com\[MAILBOX GUID] (Primary)': 126 folders created.

7/2/2019 4:01:40 PM [DATABASE6] Stage: CreatingFolderHierarchy. Percent complete: 10.

7/2/2019 4:01:40 PM [DATABASE] Stage: CreatingInitialSyncCheckpoint. Percent complete: 15.

7/2/2019 4:02:52 PM [DATABASE] InitiaStage: CreatingFolderHierarchy.l sync checkpoint completed: 113 folders processed.

Once MRS completes building the FolderHiearchy, and reaches 20 percent, it will being LoadingMessage to the service to start the CopyMessages process.

7/2/2019 4:02:52 PM [DATABASE] Stage: LoadingMessages. Percent complete: 20.

7/2/2019 4:14:25 PM [DATABASE] Stage: CopyingMessages. Percent complete: 26.

7/2/2019 4:14:25 PM [DATABASE] Copy progress: 3379/52542 messages, 102.3 MB (107,297,700 bytes)/5.534 GB (5,942,418,501 bytes), 10/127 folders completed.

It is quite common to see errors before, and during migration.  Before migration meaning, the creation of migration endpoints, preliminary sync stages.  During migration meaning while copying message, delta syncs, or completing the migration.

The challenges of moving mailboxes between databases on-premise, on-boarding Exchange Online, or off-boarding Exchange Online are all the same.  Which is why Microsoft does an excellent job providing documentation on best practices for Hybrid migration efforts.

There is a great article that describes in known solutions for hybrid migration errors.  I recommend all administrator become familiar with these errors as you will experience them on your journey to the Cloud.

Leave a Reply

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