• Hi,

    I have a network of blogs WordPress MU (not version 3 yet, using Mu2.7).
    I have a development environment and also QA and Production environments course.

    From time to time I build new blogs in development environment and want to move it later to the production.
    There is no problem in terms of the php template files, but the question is about the database.

    How can entire site blog data be exported to SQL dump fille?
    After all, apart from the specific tables that contain every blog blog’s number (the wp_nn_xxxxx tables ), there are several tables that belong to the whole system and within there are certain records that exist for each blog and blog in the site.

    I do not want to move all these tables again, and want to do no harm nor change to the things that have changed only in the production, but want an overall export from the tables that apply to a specific blog.

    I’ll try to simplify the question. Suppose I have a blog numbered 99, and I want to full export it. So, after I’ll do an import, I’ll have it fully functioning with all of its settings and specified configuration in the site. Is there a way to fully export one blog within the network (sort of c clone), and then import it to the other environment and have it live there?

Viewing 7 replies - 1 through 7 (of 7 total)
  • How can entire site blog data be exported to SQL dump fille?

    Then snag all the blog-specific tables from the database.

    The only extra things you *really* need are user tables. It also depends on the other environment. Is it single WP? Another network enabled site?

    mostly it’s about a procedure of steps.

    Thread Starter maorb

    (@maorb)

    Hi Andrea,
    Thanks for your reply.
    It is a one WPMU 2.7 install, with multi site and domain mapping plugin, running now about 100 different blogs, each one as a different site with different domain.
    I know that I can dump all the wp_(blog_id)_xxxx tables for each blog, but there are some generic tables, with no blog id , that are shared for the whole network (such as wp_blog, wp_site, wp_term_counts, wp_sitemeta, wp_siteposts etc).
    Some of these tables has fields that its values contains blog id, so I assume these are essential to be exported too.
    About users I don’t really care in this case, since there is no registration for any of these blogs and they have only one admin user and one editor user that won’t change.

    Do you have an idea what should be done with all the data that located in these kind of tables I mentioned?

    Thanks,
    Maor

    In WPMU 2.9.2 there’s a menu under Site Admin-> Global Tags meant for dealing with this exact problem (seems it was removed in WP 3.0 however). If you aren’t aggregating any of the content, then the global tags table really won’t effect each individual site. However, this menu option is there for helping mitigate a migration such as the one you are referencing.

    If you don’t have a slew of users on the dev site, just the local admin, then there’s no concern in that table either. Otherwise, you might need to either dump those users, or simply recreate them in the production environment.

    One caveat I discovered when migrating via sql dumps is the issue particularly with the options table and the serialized arrays. Doing search and replace within those can break things, especially anything in a widget.

    I found this little script invaluable for my migrations https://spectacu.la/search-and-replace-for-wordpress-databases/

    Some of these tables has fields that its values contains blog id, so I assume these are essential to be exported too.

    No, actually. Most of those global tables contain information about the network.

    Again, are you exporting the tables to a single stand-alone install or to another network?

    Thread Starter maorb

    (@maorb)

    I want to export first time from my dev environment to a QA env, and later on to production.
    It will be also a network with one WPMU in the same version, not to a lot of single WP installations.

    There are 2 main isues as I think.
    One, is I want to automate the process and if I will create tomorrow another new blog in my dev, to be able to easily transfer the new blog, and only the new blog, to the production environment.
    The second thing, is that the production has now some live sites on this networks, so the 100 blogs I need to export from dev to prod, must not damage none of the live sites.

    @miklb – It is now a WP2.7, and the next step in the upcoming month will be to see how to upgrade it to 3.0. I don’t think I’ll go to the 2.9.2, so I don’t know if I could use the global tags you offered.
    Also, I do have a main blog in the network, which holds all the articles, and then each blog on the network aggregates content using the WP-O-Matic plugin.

    Thread Starter maorb

    (@maorb)

    @mikib – I looked at the script, I think it’s not what I need in this case, which is dumping and importing MySQL tables – complete wp_nn_xxxx tables, and some partial tables somehow.

    Anway thanks, since this script might be helpful for other projects and issues.
    I’ll still be grateful to some ideas in the issue I addressed.

    Thanks

    Thread Starter maorb

    (@maorb)

    Any more ideas for the issue?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cloning blog in MU from Dev environment to Prod’ is closed to new replies.