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.
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.
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).
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
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.
The plugin will no longer reject your large file uploads.
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 <strong>and/or modify</strong> * 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/>. */