Knowledge Base

Troubleshooting mailbox migration problems caused by MAPI limits

Problem:

You are unable to continue the migration due to various errors related to exceeding default MAPI limits. After some time, mailboxes are starting to fail, showing the Error state. In the log files you may find the below errors:

Failed to open inbox folder. MAPI_E_CALL_FAILED (0x80004005).
Storage is not opened. Please open the MAPI storage and try again. module: C2ExchangeMigration.MAPI.Service.exe. MAPI function GetPropList failed. Access denied (MAPI_E_NO_ACCESS) (0x80070005).
Failed to open folder. MAPI_E_TOO_BIG (0x80040305)
Failed to open message store. MAPI_E_FAILONEPROVIDER (0x8004011d)
Unable to open MAPI message. Network error (MAPI_E_NETWORK_ERROR) (0x80040115).

Solution:

All of these errors are likely to appear while an application is intensively using MAPI libraries to communicate with the source Exchange Server. As the limits are exceeded, your source server starts to refuse incoming connections, so the migration cannot be continued. However, those limits can be easily configured to meet your migration requirements. To do so, please follow all steps below. We have used recommended values from the application's point of view. Adjust them to fit your individual preferences if necessary.

Please be aware that after applying any of the changes reconfiguring the source server connection within CodeTwo software is required.

Generic MAPI limits

Applying the configuration requires restarting the Microsoft Exchange Information Store service that should take no more than 60 seconds. You might want to consider doing that after your business hours.

  1. Go to your source Exchange server. 

    If you are running an environment with more than one Exchange server, these changes need to be done on all Mailbox servers.

  2. Open the Registry Editor.
  3. Open the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem
  4. Add new DWORD entry named Maximum Allowed Exchange Sessions Per Service with value 65536 (decimal).
  5. Add new DWORD entry named Maximum Allowed Concurrent Exchange Sessions Per Service with value 128 (decimal).
  6. Add new DWORD entry named Maximum Allowed Sessions Per User with value 65536 (decimal). 
  7. Add new DWORD entry named Maximum Allowed Service Sessions Per User with value 65536 (decimal).
  8. Add new DWORD entry named Disable Session Limit with value 0 (decimal).
  9. If you are running Exchange 2007, add an extra new DWORD entry named RPC Throttling Factor with value 5000 (decimal).
  10. Create a new registry key MaxObjsPerMapiSession. The full registry path should be as follows:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem\MaxObjsPerMapiSession.
  11. Navigate into the MaxObjsPerMapiSession key.
  12. Add new DWORD entry named objtMessage with value 2500 (decimal).
  13. Add new DWORD entry named objtAttachment with value 2500 (decimal).
  14. Add new DWORD entry named objtFolder with value 2500 (decimal).
  15. Restart Microsoft Exchange Information Store service.
  16. Go through the source server connection wizard again. More information you can find in the User Guide for CodeTwo Exchange Migration and CodeTwo Office 365 Migration.

Microsoft Exchange 2010 and newer: Throttling settings

On Exchange 2010 and later,  MAPI connections are affected additionally by throttling policies. To create a new throttling policy with unlimited MAPI connections, please execute the following command in ems Exchange Management Shell:

  • for Exchange Server 2010:
    New-ThrottlingPolicy -Name "C2Migration" -RCAMAXConcurrency $null
  • for Exchange Server 2013 and later:
    New-ThrottlingPolicy -Name "C2Migration" -RCAMAXConcurrency Unlimited

Once it is done, please assign the policy to a mailbox that was used to configure the Source connection.

Set-Mailbox -identity "MailboxName" -throttlingpolicy "C2Migration"

NSPI connection limit on Windows Server 2008 and newer

In the case of a Domain Controller running Windows Server 2008 and newer, you might encounter the MAPI_E_LOGON_FAILED error while running the migration. In such a case, please consider updating the default NSPI limit that is set to 50 concurrent connections.

  1. Open the Registry Editor.
  2. Navigate to the following registry key.
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
  3. Modify the NSPI max sessions per user entry by changing its DWORD value - the value you type here is your NSPI connections limit. If the NSPI max sessions per user entry does not exist, you need to create it.
  4. Restart the computer or restart Active Directory Domain Services.

For more details, see this Microsoft article.

Spread your mailboxes to multiple jobs 

If your source server is running Exchange 2003 or Exchange 2007, we recommend to divide your migration into a few jobs. In the case of those Exchange versions, there is no possibility to make connections unlimited. After a single job is completed, please restart the CodeTwo Migration Data Provider service. A smaller job should not exceed any limits and moreover, those are reset every time when you restart the CodeTwo Migration Data Provider service.

However, if you are experiencing any issues in the case of further jobs, please consider to go through the source server connection wizard again. All necessary information you can find in the User Guide for CodeTwo Exchange Migration and CodeTwo Office 365 Migration.