Removing the 512MB size limit on All-in-One WP Migration Plugin

A WordPress development workflow can be difficult to optimize, especially when working in a team environment. You wont have trouble finding a few well written articles online concerning version control setups and project structures. Setting up a new project is smooth when you’re using a Git repository of some flavor for your theme content, and Database Sync or a similar plugin to sync your local and live databases.

What about the case in which you inherit an existing WordPress site?

It’s not uncommon to need to pull all of a site’s plugins, settings, and media content to a local development environment at least initially. This is typically part of our “on boarding” process at work.

Simply syncing themes and databases as you typically would in your development workflow is not enough in this instance. With a plugin known as All-in-One WP Migration, you’re able to export an entire WordPress instance to a single file with an extension .wpress. You’re then able to turn right back around and import that file to another WordPress installation to create a clone.

Here is what the steps look like to export a production site to a file.

WordPress All-in-One WP plugin Migration Step 1 All-in-One WP Step 2 wpmigration3

At this point, depending upon the size of the backed up file, a blank installation of WordPress may be all that’s necessary to clone the production site.

wpmigration4

If the size of your .wpress file exceeds 512MB, you will be prompted to purchase the Unlimited Extension of All-in-One WP Migration.  If you’re inheriting a site that’s been in production for a while, it’s likely that the backup file is over this small size limit (see a fix for this below).

wpmigration7

wpmigration6

Hacking the plugin seemed like a reasonable thing to try before making the $59 dollar purchase of the Unlimited Extension (which comes with lifetime updates, and unlimited support).

Go ahead and open up /wp-content/plugins/all-in-one-wp-migration/constants.php

Lines 199:201 define the file upload size limit, there’s a nice comment there indicating such. If you’d like to control+f  “size”, it should take you right to it.

// =================
// = Max File Size =
// =================
define( 'AI1WM_MAX_FILE_SIZE', 536870912 );

You’ll see the max size is defined in Bytes. In order to increase the upload size limit to 4GB, simply multiply the number seen here by 8.

// =================
// = Max File Size =
// =================
define( 'AI1WM_MAX_FILE_SIZE', 4294967296 );

We’ve been getting lazier and doing this, which works the same as above.

// =================
// = Max File Size =
// =================
define( 'AI1WM_MAX_FILE_SIZE', 536870912 * 8 );

Save the file and navigate back to the “import” function for the All-In-One Migration Plugin. The file upload limit now reads 4GB.

wpmigration8

The plugin will no longer reject your large file uploads.

wpmigration9

wpmigration10

wpmigration11

Note that this plugin does have regular updates, and each update will reset your file upload limit. Because I use this plugin to import existing sites to my local development environment, and not as part of my regular workflow, it’s not much of a problem.

 

/**
* Copyright (C) 2014 ServMask Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

Published by

Ryan Kozak

I'm a full stack web developer living in Sacramento, CA.

118 thoughts on “Removing the 512MB size limit on All-in-One WP Migration Plugin”

  1. I was trying to figure this out myself until I did a quick Google search for it and your blog popped up. Really appreciate it. Definitely would like to see you make more tutorials to bypass other premium WordPress plugins.

    Will keep an eye out on your blog.

  2. Thanks! That’s what I needed to know. 🙂 The code was easy to find, but I’m glad you told me where to look. It saved a lot of time, and I may not have found it on my own because I would have stopped and looked for a different solution.

  3. Also, I just added a “0” at the end to multiply by 10. My file was in the higher 4GBs so I though I’d just make it a little over 5.

  4. I am getting this error in Constants.php and can’t access wp-admin. 🙁

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/n3pnexwpnas01_data02/92/3269892/html/wp-content/plugins/all-in-one-wp-migration/constants.php:1) in /home/content/n3pnexwpnas01_data02/92/3269892/html/wp-includes/pluggable.php on line 1171

    Please help me..

    1. Sorry for the late reply, I’ve been out of the country.

      Anyhow, I hope you’ve got FTP access to your site and aren’t just trying to do this through the wp-admin editor, I’d say not to modify plugins that way.

      You can just replace the all-in-one-wp-migration plugin with an unmolested version and you should be able to access wp-admin once more.

      Once you’ve got a fresh plugin and working site, go ahead and try to modify the constants.php once more as described above.

      As for the error you’ve got, from the description you gave it looks like you’ve probably accidentally inserted something (white space likely) before your opening < ?php tag in the constants.php file. Avoid doing that next go around and you should be alright. wp-content/plugins/all-in-one-wp-migration/constants.php:1 <--- the :1 indicating first line issue. Here's a link to a description of the error as well, https://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

  5. BLESS YOU BLESS YOU BLESS YOU I was about to scream in fury at how little I went over the limit, but you saved the day by providing such an easy solution! Many Thanks!

  6. Hello guys, please i need your help, am stock here, my website got hacked. but i have the WPRESS File backup of the site, how can restore my site using this WPRESS File.

    1. Install the All-in-One-WP-Migration Plugin, then import from file. If your file is bigger than the 512MB limit, then the purpose of this entire article is to get your around that, so read up.

  7. When you’re migrating a site to a fresh WP install, is it usually necessary to use the find and replace to change the old domain to the new one?

    1. You shouldn’t need to do any find and replace unless you’ve hard-coded url’s into your theme/plugins rather than using site_url(). The plugin does suggests that you toggle your permalinks after migration. For example, change them from “post name” to “plain”, then back to “post name”.

  8. I cannot download large backup file! The session might get expire. I was downloaded 287 MB and download was stuck. What is a solution for this issue? Is there any way to make this session unlimited? What is pre-solution for increase upload time? Thanks

    1. That’s odd, I’ve worked with files up to 6 Gigs and not had download errors. A solution for your download problem would be access your server via FTP, and look under /wp-content/ai1wm-backups, all the .wpress backup files are stored in that location.

      As for uploads, that would depend on the configuration of your new server. If you’re allowed to change the php.ini then set the max_upload_size to something larger than your backup file. The location of the php.ini depends on your operating system and server (Apache/Nginx).

      1. Thanks for your reply. I have downloaded the backup file, It’s 1.15 GB. When I tried to check in localhost, then I couldn’t. It stuck on 98%, what’s solution here?

        I contacted to plugin developer. They sent me another version. But it even doesn’t start the importing/restoring process and kill the localhost site! How can I finish the migration? Client will start quarrel with me 🙁

  9. Perfect solution, thank you Ryan! I have been considering purchasing the unlimited…but as I don’t anticipate shifting my sites often this brilliantly simple fix has sorted it. And now happily importing as we speak. Great tip!

  10. I first thought coming up against this was, “This is probably a very simple hack.”

    My thoughts after hacking were, “This hack was much more simple than I thought.”

    1. Perhaps ServMask needs to rethink charging people $60 dollars to change one number in a plugin that is otherwise distributed for free. If they’re relying on this for generating income then it’s stupid to implement the limit this way in the first place.

  11. Thank you for this! What will happen if I change the chunk max? My images would not show after migration, would it help to increase chunk max?
    Thank you once again.

  12. Applying this hack is no different than going to a store and taking an apple without paying for it. Also know as stealing. If you benefit from this plugin you should pay for it.

    1. I disagree. Firstly, I am not actually providing anyone with the unlimited extension, so no one is sealing anything. I’m showing people how to make the free version function without limits.

      Second, WordPress plugins are open source and open to modifications of any kind. Look at the license if you question this. Heres an exceprt from the comment section of the plugin “This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.” This post falls under the “modify it” portion.

      To counter your analogy with an analogy, I feel that I’m showing people how to grow their own apples rather than buying the $60 dollar ones the store sells. Lots of people need to migrate a site only once, that’s $60 dollars for a one time use case, which is expensive! In fact, changing one constant in your free plugin, and then selling it for $60 dollars, seems like some sheisty bullshit to me. Money grubbing by artificially imposed limits is not really the open source spirit.

  13. You, sir, are no Robinhood.
    You stole an apple and are teaching others how to steal.
    You are not helping open source spirit, you are destroying it.

    1. Tangible items like apples aren’t so easily compared with intangible things like intellectual property. Stealing is illegal, modifying source code which is licensed to allow others to freely modify it, is not illegal. So, your opinion can be your opinion, but it’s not stealing.

  14. Thanks a lot.

    In order to increase the upload size limit to 4GB, simply multiply the number seen here by 8. We’ve been getting lazier and doing this, which works the same as above.

    LOL

    1. FTP your modified version of the constants.php file to /wp-content/plugins/all-in-one-wp-migration/

      Don’t mess with anything in the storage directory unless you know why you’re doing it.

  15. Hey there,
    Thanks for your post. I wanted to restore a backup from the server which is around 8GB file. I tried changing the number of the code in order to increase size limit to more than 8GB, but it failed. Can you please help me? Thanks.

  16. Hello, thank you. I’ve done the variation and the file is imported, but at the end remains indefinitely in the window… Preparing to import…
    There is nothing
    It’s a .wpress file
    Thanks

  17. You are a doll.
    I usually use WP Twin but my client is on Dreamhost and they suck and you cannot use WPTwin, so I am only using this plugin one time.
    Thank you!

  18. Thank you very much!
    To the haters out there, the author just shared how to make the free version of the plugin work for users who have larger imports/exports; he just made it “more open-source”, that’s it. Users of the plugin may spend $60 for first hand developer support, including UNLIMITED import/export size and Trump knows what else.

  19. Day by day I loving this plugin, although I using free version, but can you please tell me how to use extension [DropBox, Google Drive, One Drive, Amazon S3, Multisite Extension, Box, Mega Etc.] to sync backup or add schedule backup? I need it if it possible. Great thanks for your help.

  20. Thank you !!! Did you know that your surname in Polish mean someone kickass? We calling “ale kozak” (what a kickass) defining cool person 🙂

  21. Thanks Master but i get this error after uploading …..
    Unable to seek to offset 41416 . pls help what should i do here?

  22. Wow just tried this ,saved the changes then reloaded the file and boom its uploading hahaha, this is pure brilliance thanks so much for finding this workaround.

    1. @Shimu,

      I haven’t had the need to do so, but I imagine it wouldn’t take more than a few hours to get something setup to scan your WP All In One Migration backup directory for changes. The plugin could record the .wpress filenames and sizes and recheck as desired. If anything changes, sync the changes with a Google Drive.

      I would start by looking here Google Drive REST API.
      https://developers.google.com/drive/v3/web/quickstart/php

  23. Did anyone noticed you also can add this code to your wp-config.php file? After an update you don’t have to replace the code in the plugin file…

    Just place this in wp-config.php file:
    define( ‘AI1WM_MAX_FILE_SIZE’, 4294967296 );

    1. Sounds like an issue with your setup or your own technical ability. If you can’t make even this simple modification work then just buy the premium extension.

  24. Thank you Ryan Kozak – you are awesome!
    10/10 for your coding & hacking skills. I’ve no issues paying for software but when it’s advertised as free, then fails at the last step, it’s not really playing fair.
    My blog is now back up and running (thanks to Google and you).
    Cheers, Bobby

  25. Awesome! Thank you so much. I agree with Bobby – exported 1GB file, waited to download and then it tells me I can’t import it.. ugh.. Now I can do it without a problem 🙂

  26. All instead of using the above procedure. can i upload the .wpress file through FTP in the backup folder and restore it via that option?
    because am still stuck at 0.00% still…
    thanks.

  27. Thanks a ton for this tip Ryan. To be honest, the plugin is the best in its kind undoubtedly. But its extensions are really costly although they’re all one-time deals. Besides, we all need testing the extensions before finally buying them.

    Can you please investigating the Google Drive and Multisite extensions?

    Appreciate your work here.
    Minh

  28. My data is more than 7GB. I tried uploading data to my localhost. but it says PHP version should be above 7 and XAMPP should be 64bit to upload more than 2 GB. I could not find the XAMPP for windows 10 in 64bit. Can you help?

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.