November 4, 2008:
Splitting WordPress Export / Import file
As part of my testing the pre-release WordPress v2.7, I set up temporary free web hosting, installed the WordPress v2.7 beta there, and then wanted to move my GBMINI.net WordPress database over to it.
Unfortunately, the MySQL database backup file is about 5MB, and I couldn’t figure a way to get that uploaded to the free hosting via phpMyadmin … so then I tried WordPress built-in Export function. Of course, that file was also huge (about 8MB), and WordPress can’t Import more than 1MB.
Searching the web, it seems you might be able to edit various PHP / .htaccess settings – but that didn’t seem to help on my free hosting either!
Manually editing the WordPress export file to split it into less than 1MB sections is quite tricky – there are various “header” lines that must precede each file, and you need to split “whole entries” so you can’t arbitrarily cut the file in to pieces!
So finally, I quickly wrote a WordPress Splitter program. Written in Visual Basic 6 (because I have it handy), it runs not too fast, but it can split my 8MB WordPress export file in to 8 <1MB files in about 20s, much faster than it would take to do by hand! I was then able to upload each 1MB file successfully, so I finally had the website content moved over to the free hosting in WordPress v2.7. And I’m quite impressed how fast the free hosting actually runs!
If you need to split a WordPress xml export file, try my WPsplitter program – but remember you might also need to download the VB6 runtime if you’ve never before run a VB6 program.
In an attempt (as yet unconfirmed) to solve people’s sometimes failures to get WPsplitter to run, I created this alternate install which adds a couple of VB6 support files that perhaps some computers are missing.
[Be careful using Export / Import, it doesn't get everything correct - I noticed that "sub-categories" weren't transferred under their parent category; maybe there's other things not transferred correctly, too]