Warning: techie stuff coming up.
I do very few How To's...but this is an exception. Apart from anything else, I'm documenting this for my benefit.
Migrating a Wordpress blog ought to be easy. If yours has been going any length of time then it can be a nightmare. Exporting everything to a Wordpress WXR/XML file is a piece of cake with modern versions of the service. Click the export button and voila! Or is it?
In my case I had a 32MB XML file. Or at least I did before I realized that WP doesn't dump Akismet captured spam until you specifically delete ALL spam BEFORE exporting. I'm glad I did because it dropped the XML file size to a more respectable 18MB.
Importing into a new blog...well that's something else, especially if your WXR file is larger than 2MB as mine clearly was. That's because in trying to be nice about file size restrictions that are common in PHP.INI on hosting sites (still awake?), Wordpress doesn't allow you to import files larger than 2MB. In practice, you're lucky if you can get close to that size because by the time you've taken attachments etc into account, you can easily break the WP import 2MB limit. Now what?
Doing a Google search on 'importing large Wordpress blogs' doesn't reveal much of use but a bit of ferreting around took me to a post on the Wordpress Codex where a moderator called Otto42 very helpfully says:
The maximum size is controlled by two PHP settings: upload_max_filesize, and post_max_size. These are PHP.INI settings, and you may or may not be able to modify them yourself. It depends on your host. So you have to ask them what the correct way to change their value is for their setup. You may need to edit the .htaccess, you may need to add a few ini_set lines to your wp-config.php file, or you may need to edit a PHP.INI file. Can't say for sure.
Clear as mud and dangerous stuff if you don't know what you're doing and sometimes dodgy even if you do. There Is a much safer method.
I found a WP file splitter at GBMini. It's a VB6 runtime so you'll probably need this file as well. If as I found when running the .EXE in my virtualized XP environment, COMDLG32.OCX is missing, then hop over here to grab the library files. Sounds horrid but it isn't. Just irritating if you're not sure what you need and run into an issue. With all the components duly installed it's then a case of running the splitter.
Once the splitter had done its stuff I ended up with 20 files. The splitter chunks your XML file into 1MB lumps but each time, it has to add the WXR header information, hence the disparity in the number of files. Now the fun part.
However many files you've got, make a list on a piece of paper 1...20 in my case. That's because you now have to import each of these SEPARATELY using the WP import routine. If you're like me, you're going to lose count and while double uploading does no harm, it's a PITA. As you upload each one, tick them off. That way you don't get lost. Or at least you shouldn't if you're methodical about it. A cup of your favourite Java helps.
As you finish importing each file, it's a good idea to scan the post list to ensure there are no errors. In my case, it couldn't 'grab' a few JPEGs. These I noted for later repair. On one file, the import routine ran out of memory so I re-uploaded and that solved the problem. I guessed - correctly - that there were a number of additional files being uploaded as attachments and it blew up. On the second run, it avoided uploading the content already in the new blog and so was able to continue through to file completion.
It took me about 45 minutes to complete the process from start to finish, including dealing with missing files. Considering the aggravation I was likely to be faced with messing around with PHP.INI, .htaccess and possibly //...import/wordpress.php, the effort was worth it. BUT - when is Wordpress (or one of their worthies) going to take GB Mini's excellent work and turn it into a plug-in that can be automated? That would remove a lot of the pain. And before anyone asks, I don't have the time to be messing around with PHP code beyond a few lines in an INDEX.PHP file.
You might think that's a strange request given the world and his dog seems to love Wordpress at the almost total exclusion of all others. At a time when data portability is supposed to be the thing, and as coroporate blogs in particular get larger, you've got to ask yourself, what would you do in the event of needing to move? Or re-implementing - which is what I was doing.
Oh - and don't forget to do automated backups
Related articles by Zemanta
- How To - Move From WordPress.com To WordPress.org (list-your-blog.com)
- How do you upgrade your WordPress? (nevillehobson.com)
- 10 WordPress Plugins for New Blogs (list-your-blog.com)
- When to quit your blog, and things you can do to try and save it (inquisitr.com)
- 21 Awesome WordPress Plugins That I Selfishly Kept to Myself Until Today (marketingpilgrim.com)
- Developing a Blog Backup Strategy - How? (davidrisley.com)
- WordPress 2.7.1 Released (weblogtoolscollection.com)
Related stories
- August 16, 2008 -- Seesmic out, Apture in (4)
- July 16, 2008 -- Wordpress 2.6: much to like (2)
- April 18, 2008 -- Big gotcha in WP 2.5 (6)
- January 23, 2008 -- Fresh faces, fresh ideas, the future (1)
Link to original post