413 Request Entity Too Large (tried both server types)

What issue or error are you experiencing?

I can’t import a site in all-in-one WP migration


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Install All-In-One WP Migration, and try to upload a large site.
I know this topic has been created a few times, but it has never been answered.
I’ve successfully set the upload limit to 10gb (arbitrary number), but i still get 413 Request Entity Too Large.
I’ve tried with both the preferred and custom installation, and with both nginx and apache. I’ve even tried setting the client_max_body_size 10000M; in nginx.conf.hbs

Please help me solve this.

edit 2024-06-09:
I think I might have found the issue. If i go to:
/Users/me/Library/Application Support/Local/run/router/nginx/conf/nginx.conf and change the client_max_body_size in there, it’s reset every time i start the server. How can i disable that change?


System Details

  • Local Version: Version 9.0.3+6684

  • Operating System (OS) and OS version: macOS Sonoma Version 14.5 (23F79)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
Logs are empty.


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

I finally figured out, how to solve this. The trick was to run on localhost instead of site domains.
When running on site domains, it looks like local resets the client_max_body_size to 1000M each time you restart a server. If you run on localhost, this prevents that. It’s not ideal, but it works.

What you do is:

  1. Change the router mode to localhost instead of site domains: settings → advanced → router mode
  2. Create a new custom site
  3. Open /Users/me/Local Sites//conf/php/php.ini.hbs and change upload_max_filesize and post_max_size
  4. Open /Users/me/Local Sites//conf/nginx/nginx.conf.hbs and change client_max_body_size.
  5. Restart site.
  6. Install the all-in-one wp migration plugin (or any other backup plugin)
  7. Go to the plugin’s import page and import.

Note, that after this was done, I have not been able to go back to site domains. That messes something up. But this is the way to do it for now.

Hopefully the localwp devs will look into this in the future.

Thank you for coming back and sharing your steps here for others to find @Dimi

Did you try any alternative methods of importing your Local site to see if those would work? If you have a backup zip of the site you can always try dragging and dropping that to start the import process. Or you can use the steps from our guide below to open up the zip and manually import as well.

Manually Import a Local Site

Yes, I also tried using the WP Migrate plugin, to export a .zip directly, but then I was just notified that the site could not be restored from the .zip file.

Within the site files is there anything like additional full site backups, DB backups, core files, etc? Those can sometimes lead to complications and errors with imports and migrations.

For clarity, we are exploring alternative migration options to make getting sites in and out of Local easier no matter where they are coming from or going to however for sites that are very large workarounds using more manual methods might still be necessary. This will always be dependent on a variety of factors though like connection, hardware, and the specific makeup of each site’s files and so on.

I am not sure what you mean about this. I tried to export the entire site with WP Migrate, because I wanted an exact replica of the site. But that didn’t work.

Sometimes within your site files you might have things like extra site backups or DB backups that were created by Backup/Migration plugins either automatically or manually at some point during development. These aren’t necessary to store within the site files at all and in fact just add a lot of bloat and increase the site’s footprint when these would be better moved to Cloud/External storage. When it comes to Local, sometimes extra files like these can confuse imports/migrations and generate errors. The core files can sometimes get grabbed by certain plugins as well and cause similar issues, since migrating core files is rarely ever necessary because the new home for the site will already have the core files ready to go.

All Local needs to import a site is simply the WP-Content (minus any of the above mentioned items) and a SQL DB. Sometimes ensuring that the site’s zip you’re trying to import is honed down to these items will resolve issues with importing or migrating.

All that isn’t to say this was 100% the issue here, it was just something I brought up as being a common culprit we’ve seen in the past and potential contributor.