Support » Fixing WordPress » Challenge for All You WordPress Wizards!

  • I’ve got a challenge for those of you who consider yourselves to be WordPress wizards…

    My client inherited a (badly designed) web site running on WP 2.8.5. I’m redesigning the site and putting WP 2.9.2 behind it. Her current site uses an elaborate hierarchy of categories and posts. I’ve been able to duplicate the hierarchy but hit a brick wall when trying to figure out how to get the content from her current site to the new one. Her wp_posts table has about 6,000 rows, although many are “post revisions”. I think in reality there are about 1,200 actual posts spread among about 120 categories.

    I can’t do the WordPress export / import dance because I think it will break a lot of stuff I’ve got set up for the new site. I really just need to transfer the posts data and don’t want to mess with anything else. I’ve tried doing a raw SQL table export, thinking I could tweak a few things then do a bunch of SQL “INSERT”s on the new site. But there seem to be some wp_posts table changes between 2.8.5 and 2.9.2, plus I think there may be some foreign keys that won’t get set up correctly.

    I hate the thought of having to manually re-enter all the content, post by post. Even if it took only one minute to do each one, I’d need about 20 hours to get everything in there. There’s got to be a better way, right? (Please?)

    Does anyone have any clever ideas on how I can do this other than brute force?


Viewing 5 replies - 1 through 5 (of 5 total)
  • SQL.

    DELETE FROM wp_posts WHERE post_type = "revision";

    @ipstenu – OK, that gets rid of the rows that are revisions. But I don’t think I can just import the wp_posts table into the new database in isolation. Aren’t there keys into other tables that would not get set properly? And what about category IDs?

    Well you should copy the WHOLE database over. 🙂

    Export the database from within phpMyAdmin or such, and import it into SQL on the new box. It’s pretty much just resorting a DB:

    I will note this will retain the server name and such so if THOSE are changing, change them in WordPress before you export. Or be prepared to edit the SQL manually later.

    The current site is live and I’m doing the new site on a development server, so the server name will be different. But I don’t think that’s a big deal. I’m comfortable enough looking at SQL and tweaking raw code.

    My concern is that simply bringing the entire old database over will break a lot of stuff in the new site. The current site has a certain combination of pages and posts (and I mean that in the WordPress way). The new site has a certain, but different, combination of pages and posts. Plus, some categories (and their hierarchy) have changed. So there’s not a 1:1 matching from the current site to the new one.

    I guess I was hoping there was a way to export just the posts from one site, then import them into the new one, while leaving everything else alone. I suppose I could do a full db backup on the new site, then try your suggestion to see what happens. But I anticipate a lot of problems, if the site even loads in a browser.

    Yeah, you’re kind of going about this in a weird way. What you’re doing is merging two sites, not moving, which is going to make your head ache. Let’s rewind a moment 🙂

    I can’t do the WordPress export / import dance because I think it will break a lot of stuff I’ve got set up for the new site.

    Why? No, really, why? I’ve done this a dozen times, when merging sites specifically. I exported posts based on tags and cats, and then imported them. That’s pretty much your best bet.

    Alternately? Copy the database over to your new site, make CHANGES to design your new site, and then when you’re ready, export ONLY the new posts/pages, import, and switch the DBs.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Challenge for All You WordPress Wizards!’ is closed to new replies.