When you maintain websites, you often have to move a WordPress site to another server. You change hosts, or you copy the site to your own computer to check something before it goes live.
I had been using a migration plugin for this, but with large sites I ran into its size limit every time. Each time, I had to edit the plugin’s configuration file to lift the limit. And when the destination was LocalWP, my local development environment, I needed a separate step to rebuild the export into a form LocalWP could import.
So I built a migration plugin myself and released it in the official WordPress.org plugin directory as “Unbox by oobe”. Every feature is free.
What Unbox does
It packs a site’s files and database into a single file, and restores them on another WordPress install in a state that simply works. The main points are these.
- There is no size limit. Export and import both run in small steps. Uploads are split to fit the server’s limit, and if the server refuses a piece, Unbox splits it smaller and sends it again
- It can export a zip for LocalWP. The zip goes straight into “Import site” in LocalWP. The URLs are already replaced with
http://your-site.local, and WordPress itself can be included - It works behind Basic authentication or a WAF. Every step is driven from the browser, so the server never sends requests to itself
- It can import
.wpressfiles from All-in-One WP Migration. If the destination uses that plugin, Unbox can export as.wpresstoo - It can carry folders outside WordPress. Folders that sit beside WordPress, such as a folder of static pages, can be selected and moved along with the site
The exported file is placed in a folder with a name that cannot be guessed, and only an administrator can download it, from the admin screen. Unbox makes no outside connections.
How to use it
- Install Unbox on the source site, go to Tools → Unbox, choose a format and export
- Download the file it produces
- Install Unbox on the destination site too, and drop the file onto the Import tab
- Check the destination URL, then start the import
- When it finishes, log in again as a user of the source site
To move a site into LocalWP, choose the zip for LocalWP when you export, then pick it in LocalWP under + → “Import an existing site”.
Built so that a stop partway does not break the site
The thing you most want to avoid in a migration is the process stopping partway and taking the original site down with it. This is where I spent the most effort in Unbox.
The database is never overwritten directly. Unbox first imports into temporary tables, and swaps them in with a single operation at the very end, once everything is in place. If it fails partway, the current site’s database stays as it is.
Files work the same way. Each incoming file is first written to the end under a different name, then renamed to its real name. This prevents the accident where a half-written plugin file gets loaded and stops the process itself.
Each run is cut off at 20 seconds at most, and Unbox records how far it got. Even if it hits the server’s execution time limit, it resumes from where it stopped. Before releasing it, I confirmed that it can move a site of more than 20 GB all the way through.
What I fixed during the official directory review
To publish on WordPress.org, a plugin has to pass a review by volunteers. Mine was approved after three rounds. Here are the main things I fixed in response.
- The name: I first applied with the single word “Unbox”. The reviewers pointed out that there are trademarks and companies with the same name and that it could not be told apart. I added my business name and made it “Unbox by oobe”
- Database access: To read large tables quickly, part of the code connected to the database directly. I rewrote it to go through the standard WordPress mechanism
- A trick used during migration: To pause other plugins only while importing, Unbox automatically placed an executable file. Plugins are not allowed to write executable files, so I switched to the approach described above: write under a different name, then rename
Every point had a clear reason behind it: making the plugin safe to run in other people’s environments. I feel the code is more straightforward after the fixes than it was before.
Summary
- Unbox by oobe is a free plugin that moves an entire WordPress site with no size limit
- It can also export a zip that LocalWP imports as it is
- Both the database and the files are swapped in at the end, so the current site is not broken if the process stops partway
- You can download it from its plugin page on WordPress.org. The source code is public on GitHub
If you would like to leave a site move, or the setup of an environment for maintenance, to someone else, write to me through the contact form.