Going to install tonight, have some questions

Hello, I am a new user here and I will be doing the Multi-db conversion tonight hopefully :slight_smile:

But before that I have a few questions, is the script fully compatible with previous versions? I am currently using version 1.5.1

Also, what does the DC mean? Also, is the LAN_HOST ip needed? I have my own dedicated box, should I just leave it to be 127.0.0.1?

I will be splitting the db to 256 databases, I have around 3-4k blogs at around 28k tables. I should be ok with this I guess.

Thanks for the help :slight_smile:

  • Andrew
    • Champion of Loops

    Hi,

    But before that I have a few questions, is the script fully compatible with previous versions? I am currently using version 1.5.1

    Use Mulit-DB 1.0.1 on WPMU 1.5.1 installs.

    Also, what does the DC mean?

    Just leave it set to dc1.

    Also, is the LAN_HOST ip needed? I have my own dedicated box, should I just leave it to be 127.0.0.1?

    If MySQL and your web server are on the same box then just use localhost for everything.

    I will be splitting the db to 256 databases, I have around 3-4k blogs at around 28k tables. I should be ok with this I guess.

    Yep, just follow the instructions and you should be just fine :slight_smile:

    Thanks,

    Andrew

  • Konstantin
    • Design Lord, Child of Thor

    Ok thanks, once my backup is done I’ll go ahead with the splitting.

    One more thing, the add_dc_ip should be pointing to my server? Since the example is 123.123.123. leaving a blank after the . I am not sure if I should just add my server ip in there (as in, full ip).

  • Andrew
    • Champion of Loops

    One more thing, the add_dc_ip should be pointing to my server? Since the example is 123.123.123. leaving a blank after the . I am not sure if I should just add my server ip in there (as in, full ip).

    If your server IP is 67.74.102.48 this would be what you need to enter:

    67.74.102.

    Thanks,

    Andrew

  • Konstantin
    • Design Lord, Child of Thor

    Gotcha.

    Last thing I think, I need to add a add_db_server(‘global’:wink: before all the other tables right? So in fact, I should have 257 lines in total. The 256 db and the global one?

    Edit: I suppose I have to create the global db as well, or will the move-blogs script do it for me?

  • Konstantin
    • Design Lord, Child of Thor

    Ok, I think I am all set. I was looking over at the move_blogs script and I see that I need to enter a $newdb_prefix, which in my case will be bloghost_wpmu_XXX. Then on line 101 there is $newdb_prefix.”_global”;, I removed the _ in there because this would create bloghost_wpmu__XXX with a double __, am I right?

  • Konstantin
    • Design Lord, Child of Thor

    Is this normal when using move_blogs.php?

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /x/public_html/wp-content/scripts/move_blogs.php on line 124

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /x/public_html/wp-content/scripts/move_blogs.php on line 125

    I am getting that for each blog it tries to move :S PHP version 5.2.5 and MySQL version 5.0.51a. Will report back once the script stops running to see if the blogs were moved.

    Edit: crap, only half the blogs were moved :slight_frown: Running script again.

  • Konstantin
    • Design Lord, Child of Thor

    Ran the script again and everything was moved. What do I do with my old database now? The site seems to be working fine (so far all I’ve noticed is the MuTags not working). My original wpmu db has 28k tables, do I just leave it there?

  • Andrew
    • Champion of Loops

    Is this normal when using move_blogs.php?

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /x/public_html/wp-content/scripts/move_blogs.php on line 124

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /x/public_html/wp-content/scripts/move_blogs.php on line 125

    Just ignore those errors.

    Ran the script again and everything was moved. What do I do with my old database now? The site seems to be working fine (so far all I’ve noticed is the MuTags not working). My original wpmu db has 28k tables, do I just leave it there?

    I’d leave it intact for a week or two just to be sure you don’t need it. If you need the space you can make a backup of the original db, compress it, and then drop the actual db.

    Thanks,

    Andrew

  • Konstantin
    • Design Lord, Child of Thor

    Ok, I’ll leave it for a while. Got MuTags fixed by following a post on these forums :slight_smile:

    Could you explain briefly how Multi-db works? Since I have a wp-config file which has my old bloghost_wpmu database defined, and now with multi-db the stuff is all across lots of databases, does the define_db in wp-config gets ignored and goes to wp-content/db.php?

  • Luke
    • The Crimson Coder

    does the define_db in wp-config gets ignored and goes to wp-content/db.php?

    Pretty much. When there is a db.php file in wp-content, WordPress ignores the stuff in wp-config, and uses the db-config file to get the connection information.

    The “easiest” way to tell if you’re up and running is to find the db where you’re home blog (blog_id 1) is (should be db c4 on a 256 setup), make one minor edit to the database (like an unnoticeable change to a post title, or setting like site name or something), and see if the blog changes.

    Or, if you’ve made a post since moving, see if it’s in the wp_1_posts table, etc. You could also add a new category, and look for it as well.

    If the change is reflected in the migrated db (c4), then you’re up and running. At that time, you can take some dumps (in pieces) of the original DB, and get rid of it. :slight_smile:

    Hopefully you didn’t use the original DB as your global db. If you didn’t, you can leave it in place for a while, but if you’re on multi-db and it’s working, leaving it there really only eats up space. :wink:

  • Konstantin
    • Design Lord, Child of Thor

    Ok, found my dev blog in c8 (wp_2), took me a while to find :stuck_out_tongue: The update post I made was in there, while in the original database it seems like its not there :slight_smile:

    What do you mean dump in pieces?

  • Luke
    • The Crimson Coder

    Great. :slight_smile:

    “What do you mean dump in pieces?”

    Assuming you’re using PhpMyAdmin, you can’t just do a dump on 28k tables. It will time out and take forever.

    Instead, you’ll have to grab about 100 blogs at a time. Still takes forever, but at least it doesn’t: a) bog down the server, and b) give you an incomplete dump.

    If you can go command line, you should be able to dump the whole thing. :slight_smile:

  • Konstantin
    • Design Lord, Child of Thor

    Ah gotcha. I did a full dump before installing the Multi-db. Took a few hours since it had so many tables, which is actually one of my main reasons to go with this new db schema. Now each db is at average 2mb which should take little time in backing up :slight_smile:

    Thanks for all the help guys, the whole process went smoothly! (except the first time I ran move_blogs because I accidentally messed up the browser window where it was running and it stalled). I didnt dump the tables already moved but seems like the script worked anyway. Everything is where its supposed to be :slight_smile:

  • Konstantin
    • Design Lord, Child of Thor

    Just checked my error logs and I am getting this:

    [Wed Sep 03 20:26:15 2008] [error] [client 190.138.233.202] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /hx/wp-content/db.php on line 447, referer: http://search.live.com/results.aspx?mkt=es-xl&FORM=TOOLBR&q=FOTO+LUCIANO+GARBELLANO&FORM=TOOLBR

    [Wed Sep 03 20:22:08 2008] [error] [client 200.104.109.144] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /x/wp-content/db.php on line 226, referer: http://www.google.cl/search?hl=es&cr=countryCL&q=luis+santiba%C3%B1ez&start=10&sa=N

    [Wed Sep 03 20:13:13 2008] [error] [client 66.249.71.24] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/bloghost/public_html/wp-content/db.php on line 238

    [Wed Sep 03 20:03:44 2008] [error] [client 66.249.71.23] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/bloghost/public_html/wp-content/db.php on line 240

    When I visit the urls that appear from those search strings the page does load (at least the times I’ve tried). I am not sure why its showing fatal errors.

  • Luke
    • The Crimson Coder

    Maybe a PHP version issue?

    If your PHP version is still on 4.x, you could perhaps swap out mdb1.0, and try the db.php file from there. The 1.0.1 update was for a PHP5 issue. :smiley:

    Not that it may be the problem, and 1.0.1 should be just fine on PHP4, but you never know. :slight_smile:

    We’ve got plenty of sites (ours and clients)

    Yep, I’ll second that one.

  • Konstantin
    • Design Lord, Child of Thor

    Another question I have, how can I find where each table is? I mean, if I want to find blog id 2000, how do I know which database to look for? Or, what command can I use in phpmyadmin to find for example wp_2000_posts across all the databases?

  • Luke
    • The Crimson Coder

    That is a good question. If only there was a filter/action hook where you could tie into the blog information on the main blogs page.

    Me personally, I add a little modification to the first field with the blog_id. I put the first 3 characters (or 2, or 1, whatever) of the md5 hash of the blog_id on a new line right below the blog id.

    So you end up with something like this:

    1

    c4c

  • Andrew
    • Champion of Loops

    The blogs are spread over the databases depending on the first 1, 2, or 3 character(s) of the md5 hash of the blog id.

    So for example, the main blog with the blog id of ‘1’ would have the hash:

    c4ca4238a0b923820dcc509a6f75849b

    If you’re using 16 databases then that blog would be in database PREFIX_c. For 256 databases it would be in db PREIX_c4 and for 4096 PREFIX_c4c.

    Thanks,

    Andrew