This is less a proposal for a new feature, and more a discussion about a drastically lacking capability in WordPress.
It’s not portable.
WordPress Export/Import
WordPress ships with the ability to export content in XML format (using a WordPress-specific format called WXR). This is great for a quick backup, but ultimately lacks what many publishers are expecting out of a “portable” application.
The WXR file contains insufficient information to recreate a site from scratch. Among the most important elements missing:
- User meta information (including hashed passwords) – users must be entirely recreated on the target site
- Attachments – media can be downloaded and imported into the new site only if the original site is still online and the media is accessible
- Site settings – tagline, comment/pingback settings, timezone configuration, etc
Despite lacking some vital information, WXR files often grow large as a site continues to build up content. Unfortunately, this often means an export is too big to be safely imported to its new home.
Developers have even built WXR file splitters to help break things down a bit. The tools are nifty, but that they’re necessary shows we have a problem.
Database Dumps
More and more frequently, I find myself turning to lower level database tools to facilitate a large migration.
I’ll use [cci]mysqldump[/cci] to export the database, copy it to the target server, then use MySQL’s command line tools to re-import the same database. After that, some magic with WP-CLI lets me replace any broken strings (i.e. changed domains) in the database without forcing me to do it by hand.
This process is much quicker than chunking a WXR file, importing chunks one at a time, and manually updating settings and other missing data. But it’s still inefficient.
Some sites have relatively small databases – with data dumps consisting of only a few MBs of data. Other sites have much larger systems – with data dumps starting at 1.5GB. It’s one thing to keep this much data in a database; it’s another to use it for a migration (or work to verify the integrity of the data once it’s made it across the wire).
An Ideal World
I love the fact that MySQL makes data retrieval quick and helps optimize searching for and working with individual objects within the database. I hate the fact that MySQL makes it so difficult to move content from one server to another.
In an ideal world, WordPress would be decoupled from its data store – allowing me to swap out MySQL for, say, flat-file YAML documents for data storage. Being able to work with multiple data systems would enable site administrators to dump their content from one format to another and back again losslessly.
WXRs are lossy – they omit some important information. MySQL dumps aren’t lossy, but are too rigid – you can only map MySQL to MySQL, and only if you have direct DB access.[ref]If you’ve ever tried to copy-paste a large database dump into phpMyAdmin, you know exactly what I’m talking about.[/ref]
I would love the ability to, with a click, dump my entire site to a set of somewhat human-readable flat-files. I would love even more to use those same flat-files to dynamically recreate my entire site on another server with no loss in data.
If and when WordPress reaches this state, the product (and the content it helps maintain) will be truly portable.