Importing to WordPress from a text file

I had a website of football reports which was managed by a homebrew flat-file database, and it really needed dragging into the 21st century and being managed by WordPress, or something like that. But how to transfer the hundreds of entries, with all their dates and categories? It turned out to be surprisingly easy, assuming you can export from your database in a specific, user-defined format.
Wordpress has a whole list of import filters (see the “Manage” tab), each dedicated to a specific format. One of these is “RSS”, which takes an RSS feed and converts it into WordPress posts. That’s the one you need. Here’s the procedure:
1. Create your WordPress blog, which – when new – should have one sample entry.
2. Export this to RSS, using Manage > Export. This will give you a “Wordpress RSS format” file, which gives you the template you’ve now got to recreate from your old database. If the database can’t be set up to export a file which looks like that, consider exporting it however you can and using some intelligent search-and-replace procedures to add in all the extra material required.
3. Import your file to WordPress using Manage > Import! I’d try it with just a couple of entries until you get it right, because if it’s wrong, you’ll have to delete what you’ve added, and mass-deletion of entries in WordPress is a real chore.
One notable exception which I discovered is that categories do not transfer if you just copy the exported RSS file you’re using as a template. For some reason, in the sample template file, the post category gets surrounded by “CDATA”, like this:
<category><![CDATA[my category name]]></category>
If you recreate that in your database export file, the categories get ignored. But remove the CDATA part, and everything is fine! The category entries in your file should simply look like this:
<category><my category name></category>
Anyway, here’s my new WordPress-powered football reports blog! The 150 or so entries up to 10 November 2007 were all imported from my old FoxPro database.
Got anything to say? Go ahead and leave a comment!
Looking for stuff to buy? Try these...
What else is new?
- My View: Cambridge City Council Elections 2012 – Queen Edith’s Ward
- iTunes Match – what happened when I tried it
- Cineworld: run by robots who just don’t care
- My Top Ten Movies of 2011
- Why you shouldn’t leave your passwords in your Will
- Our Experience of Moving House in Cambridge
- Virgin Media “Customer Service” lives up to its reputation
- In Defence of the Olympic Tickets System
- Brit Floyd, Cambridge Corn Exchange, April 2011
- The Unthanks, Cambridge Junction 2, April 2011
- TV Comedy Spin-off Books From The Eighties!
- Spamalot: my favourite scene
- Big upload speed increase from Virgin Media cable internet
- Album of the Year so far
- My Favourite Apps of 2010
- My Favourite Sporting Moments of 2010 (Part 2)
- My Favourite Sporting Moments of 2010 (Part 1)
- My Favourite Gadgets of 2010
- My Favourite Online Videos of 2010
- My Favourite Websites of 2010
- My Favourite TV Programmes of 2010 (Part 2)
- My Favourite Blogs of 2010 (Part 3)
- My Favourite Live Performances of 2010
- My Favourite Radio Programmes of 2010
- My Favourite Movies of 2010
Me Tweet quite a bit
- RT @AndrewMaleMojo: Dexys 2012 live were astonishing. But this, this is... *mouth moves, words do not come out*: http://t.co/S2UjCkKQ <- Yes 1 hour ago
- Glad I work from home, vol. 45,193: interesting-sounding Dexy's doc on Radio Four later this morning: http://t.co/q8emwHHQ 2 hours ago
- Headline of the Day. Oh yes, it all happens here in the Fens. http://t.co/2YeUDWEY 3 hours ago
- "Enough placebo politics. Vote for the geeks" by David Aaronovitch (Times subscription required) http://t.co/kimmfgMY 3 hours ago
- Aaronovitch: "perhaps we shall see a day (with) a cabinet presided over by Stella Creasy, Therese Coffey or even Julian Huppert". I wish. 3 hours ago




Posted under: