Knowledge Base

Troubleshooting the 'Request Entity Too Large' error

Problem:

During the migration, you are unable to upload big items to your target on-premises Exchange server, due to the following error:

Error while uploading package. System.Exception: The request failed with HTTP status 413: Request Entity Too Large. 

Solution:

The problem occurs due message size limits set for Exchange Web Services (EWS) or to limitations of your target IIS server. 

Important

In the case of EWS limits, make sure to apply the solution provided in this Knowledge Base article first. If that doesn't solve your problem, apply the solution outlined below.

CodeTwo migration software is exceeding the upload limit on your target Internet Information Services Server (IIS). To avoid this problem, you can customize the value of uploadReadAheadSize property, which by default is set to 49152 KB (about 50MB). To do so, please follow steps below:

  1. Please log on to the target EWS machine in the target environment as a user with administrative privileges.
  2. Navigate to the following directory:
    %windir%\System32\inetsrv
  3. Hold Shift button and right click on the empty space in Windows Explorer, then select Open windows command here.
  4. Execute the following command, swapping <limit> for a desired value in bytes:
    appcmd.exe set config -section:system.WebServer/serverRuntime /uploadReadAheadSize:"<limit>"

    To set the limit to maximum possible value, run:

    appcmd.exe set config -section:system.WebServer/serverRuntime /uploadReadAheadSize:"2147483647"
  5. The reboot of IIS server is not required, however, you might need to restart the IIS with the following command:
    iisreset