<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>billbailey.co.nzMulti Database | billbailey.co.nz</title>
	<atom:link href="http://www.billbailey.co.nz/tag/multi-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.billbailey.co.nz</link>
	<description>SEO, Affiliate Marketing, Graphic Design, Web Development</description>
	<lastBuildDate>Thu, 01 May 2014 11:09:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.23</generator>
	<item>
		<title>Multi-Database Step by step Installation</title>
		<link>http://www.billbailey.co.nz/multi-database-step-by-step-installation/</link>
		<comments>http://www.billbailey.co.nz/multi-database-step-by-step-installation/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 02:42:12 +0000</pubDate>
		<dc:creator><![CDATA[Author]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web2]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WPMU]]></category>
		<category><![CDATA[Multi Database]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress Themes]]></category>

		<guid isPermaLink="false">http://www.billbailey.co.nz/?p=90</guid>
		<description><![CDATA[Step by step installation Guide for Multi DB Introduction When I first read about Multi DB I was lured by the fact that it could streamline and break my 10,000 Table Single wp-freeblog Database into many such as 16, 256, 4096, databases, &#8220;yeah I thought, Millions of Blogs!&#8221;. Whooa down, lets get real you need [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2 style="text-align: left;">Step by step installation Guide for Multi DB</h2>
<h3><span style="font-size: large;">Introduction</span></h3>
<p style="text-align: left;">When I first read about Multi DB I was lured by the fact that it could streamline and break my 10,000 Table Single wp-freeblog Database into many such as 16, 256, 4096, databases, &#8220;yeah I thought, Millions of Blogs!&#8221;.</p>
<p style="text-align: left;">Whooa down, lets get real you need to be realistic about where you will be in the Future I personally think 256 Databases is a good starting Place lets face it if you get that many you will probably be making some OK money or at least be Making enough to keep developing your Platform Ok pic a number</p>
<ol style="text-align: left;">
<li>16 Databases Up to 10,000 BLOGS</li>
<li>256 Databases Up to 50,000 to 100,000 Blogs</li>
<li>4096 Database Up to 4,000,000 Blogs</li>
</ol>
<p style="text-align: left;">
<h3 style="text-align: left;"><span style="font-size: large;">Step 1</span></h3>
<p style="text-align: left;">The first thing to do is try to create your databases now this is either Straight Forward or not depending on your server restrictions, if there are restrictions then you will possibly need to change hosts or get the server Folk to CREATE the databases and GRANT PRIVILEGES to your account for these Databases</p>
<p style="text-align: left;">How I Create Databases thru the Command Line. (Building This now)</p>
<p style="text-align: left;">Go Now and Create your Databases done then Come Back here when you have got this sorted, As we cannot move on untill its done.</p>
<p style="text-align: left;"><span id="more-90"></span></p>
<p>[ad#post-ad]</p>
<h3 style="text-align: left;"><span style="font-size: large;">Step 2</span></h3>
<p style="text-align: left;">Get the latest Multi DB Plugin  <a title="Multi Dtabase" href="http://premium.wpmudev.org/" target="_blank">HERE</a> and Unpack it on your own Local Machine</p>
<p style="text-align: left;">This is what should be inside  see the contents of this Folder minus the Zip folder,  the install notes here will only help you  put the files and Folders in the right directories which is a little dangerous Initially,  I actually Broke My site by uploading the Wrong file out of sequence so listen up</p>
<p style="text-align: left;"><strong>Below is the contents of the Multi DB Plugin</strong></p>
<p style="text-align: left;"><a href="http://www.billbailey.co.nz/wp-content/uploads/2009/02/multi_db_software.gif"><img class="size-medium wp-image-87 alignnone" title="multi_db_software" alt="" src="http://www.billbailey.co.nz/wp-content/uploads/2009/02/multi_db_software-300x224.gif" width="300" height="224" /></a></p>
<h3 style="text-align: left;"></h3>
<h3 style="text-align: left;"><span style="font-size: large;">Step 3</span></h3>
<p style="text-align: left;">OK  So you Now have your down Load  its unzipped on your local machine we are cranking</p>
<p style="text-align: left;">Now you need to take it easy here no rush load these files into  the appropriate folders</p>
<p style="text-align: left;">Firstly create a folder Called <strong> wp-content/scripts/ </strong>then load the following files</p>
<p style="text-align: left;"><strong></strong><strong>list-hashes.php</strong> &#8211; goes in /wp-content/scripts/<br />
<strong>move-blogs.php</strong> &#8211; goes in /wp-content/scripts/</p>
<p style="text-align: left;">Add these files into these directories</p>
<p style="text-align: left;"><strong>db.php </strong>- goes in   /wp-content<br />
<strong>db-config.php</strong> &#8211; goes in /wp-content/</p>
<p style="text-align: left;">Make sure that you do not FTP upload these yet, we need to groom them first!</p>
<h3 style="text-align: left;"><span style="font-size: large;">Step 4</span></h3>
<p style="text-align: left;">Ok lets establish<strong> </strong>which files need be edited</p>
<p style="text-align: left;"><strong><span style="text-decoration: underline;">You do not need to edit the files below</span><br />
</strong></p>
<ul>
<li><strong>db.php</strong></li>
<li><strong> list-hashes</strong></li>
<li><strong> server-ip.php</strong></li>
</ul>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>The files you will need to edit</strong></span></p>
<ul>
<li><strong>move-blogs.php</strong></li>
<li><strong>db-config.php</strong></li>
</ul>
<h3 style="text-align: left;"><span style="font-size: large;">Step 5</span></h3>
<h3 style="text-align: left;">Lets Get editing this is the area we need to take care saves a lot of time</h3>
<ol>
<li><strong> move-blogs.php</strong> &#8211; which sits in <strong>/wp-content/scripts/move-blogs.php</strong></li>
</ol>
<p style="text-align: left;">The only parts you will need to edit of  <strong>move-blogs.php</strong> are below</p>
<p style="text-align: left;">$dbname ( <strong>your_current _database</strong> )<br />
$blog_table_prefix ( <strong>wp_</strong> %99 chance this wont need changing )<br />
$newdb_prefix ( <strong>mynewprefix_</strong> this is the prefix to your new 16, 256, 4096 databases )</p>
<p style="text-align: left;">Then you need to change the database connection details such as below</p>
<p style="text-align: left;">$dbhost = &#8216;<strong>localhost</strong>&#8216;;     this is probably fine no need to change<br />
$dbuname = &#8216;<strong>username</strong>&#8216;;  this is your Business<br />
$dbpass = &#8216;<strong>password</strong>&#8216;;  this is your Business</p>
<p style="text-align: left;">$db_scaling = &#8216;<strong>256</strong>&#8216;; this is where you put the amount of Databases</p>
<p style="text-align: left;">Here is part of the <strong>move-blogs.php file</strong></p>
<p style="text-align: left;"><code> /*<br />
Plugin Name: Multi-DB (Conversion Tool)<br />
Plugin URI: http://XXXXXXXXXXXXXX/project/Multiple-Databases<br />
Description:<br />
Author: Ron Dillehay - FanMail to rdillehay@hotmail.com (no tech support please) - Modified slightly by Andrew Billits (Incsub)<br />
Version: 2.6.0<br />
Author URI:<br />
Descriptiom:<br />
This script is to move blogs from a wordpress mu single database setup, to a wordpress mu multiple database setup using an MD5 hash to establish blog routing<br />
Use this script at your own risk. My test setup uses php 5, mysql 5, and wordpress mu 1.2.5a<br />
*/ </code></p>
<p style="text-align: left;">//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;//<br />
//&#8212;Config&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;//<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;//</p>
<p style="text-align: left;">///DB Settings<br />
$dbname = &#8220;<strong>your_current _database</strong>&#8220;; //This is your current database<br />
$blog_table_prefix = &#8216;<strong>wp_</strong>&#8216;; //Prefix of your wpmu blog tables, most likely this won&#8217;t need to be changed<br />
$newdb_prefix = &#8216;<strong>mynewprefix_</strong>&#8216;; //This is the prefix of the db&#8217;s you&#8217;re moving your tables into &#8211; we assume they are all the same, if not, you&#8217;re in trouble</p>
<p style="text-align: left;">//We need info to connect to the databases<br />
$dbhost = &#8216;<strong>localhost</strong>&#8216;; this is probably fine<br />
$dbuname = &#8216;<strong>username</strong>&#8216;;<br />
$dbpass = &#8216;<strong>password</strong>&#8216;;</p>
<p style="text-align: left;">//How many db&#8217;s are you moving into (16, 256, or 4096)?<br />
$db_scaling = &#8216;<strong>256</strong>&#8216;;</p>
<p style="text-align: left;">//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;//<br />
?&gt;</p>
<h3 style="text-align: left;"><span style="font-size: large;">Step 6</span></h3>
<p style="text-align: left;"><strong>We have to edit and  correct</strong> the <strong>move-blogs.php</strong> (which will throw you if your not ready)</p>
<p style="text-align: left;">Note**  there is a typo in this file which still hasn&#8217;t been corrected YET its to do with<strong> line 83</strong> and <strong>line 85 </strong>instead of a<strong> hyphen -</strong> there is an <strong>underscore  _  between move-blogs.php<br />
</strong></p>
<p style="text-align: left;">This is the original part  of<strong> move-blogs.php</strong><strong> </strong>file that is incorrect</p>
<p>//////////////////////////////////////////////////////////////////////////////////////////////</p>
<p>line 79 echo &#8220;&lt;table align=&#8217;center&#8217; class=&#8217;stats&#8217;&gt;&lt;tr&gt;&lt;td colspan=&#8217;4&#8242; align=&#8217;center&#8217;&gt;&lt;br /&gt;&lt;ol&gt;<br />
line 80   &lt;li&gt;Tested on PHP 5 &amp; MySQL 5&lt;/li&gt;<br />
line 81   &lt;li&gt;Make sure all of your new db&#8217;s exist (green text next to table name in db column below)&lt;/li&gt;<br />
line 82   &lt;li&gt;In the status section, each table should show &lt;i&gt;not in new db (unless you&#8217;ve already run this script)   &lt;/i&gt;&lt;/li&gt;<br />
<strong>line 83</strong> &lt;li&gt;To start the copy process &lt;a href=&#8217;<strong>move_blogs.php</strong>?table=copy&#8217;&gt;click here&lt;/a&gt; &lt;/li&gt;<br />
line 84  &lt;li&gt;Be patient, depending on how many blogs you have, this could take a while&lt;/li&gt;<br />
<strong>line 85</strong> &lt;li&gt;Once completed, refresh this page by &lt;a href=&#8217;<strong>move_blogs.php</strong>&#8216;&gt;clicking here&lt;/a&gt;&lt;/li&gt;<br />
line 86  &lt;li&gt;Check to make sure that in the status section all tables say &lt;i&gt;table in new db&lt;/i&gt;&lt;/li&gt;<br />
line 87  &lt;li&gt;Rejoice, I probably just saved you hours of your life!&lt;/li&gt;<br />
line 88  &lt;li&gt;If this didn&#8217;t work, don&#8217;t blame me.  Sometimes life is just like that..&lt;/li&gt;&lt;/ol&gt;<br />
line 89  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;table name&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;table info&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;new db&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;status&lt;/td&gt;&lt;/tr&gt;&#8221;;</p>
<p>/////////////////////////////////////////////////////////////////////////////////////////////</p>
<p style="text-align: left;">This is the corrected original file<strong> move-blogs.php</strong></p>
<p>line 79 echo &#8220;&lt;table align=&#8217;center&#8217; class=&#8217;stats&#8217;&gt;&lt;tr&gt;&lt;td colspan=&#8217;4&#8242; align=&#8217;center&#8217;&gt;&lt;br /&gt;&lt;ol&gt;<br />
line 80   &lt;li&gt;Tested on PHP 5 &amp; MySQL 5&lt;/li&gt;<br />
line 81   &lt;li&gt;Make sure all of your new db&#8217;s exist (green text next to table name in db column below)&lt;/li&gt;<br />
line 82   &lt;li&gt;In the status section, each table should show &lt;i&gt;not in new db (unless you&#8217;ve already run this script)   &lt;/i&gt;&lt;/li&gt;<br />
<strong>line 83</strong> &lt;li&gt;To start the copy process &lt;a href=&#8217;<strong>move-blogs.php</strong>?table=copy&#8217;&gt;click here&lt;/a&gt; &lt;/li&gt;<br />
line 84  &lt;li&gt;Be patient, depending on how many blogs you have, this could take a while&lt;/li&gt;<br />
<strong>line 85</strong> &lt;li&gt;Once completed, refresh this page by &lt;a href=&#8217;<strong>move-blogs.php</strong>&#8216;&gt;clicking here&lt;/a&gt;&lt;/li&gt;<br />
line 86  &lt;li&gt;Check to make sure that in the status section all tables say &lt;i&gt;table in new db&lt;/i&gt;&lt;/li&gt;<br />
line 87  &lt;li&gt;Rejoice, I probably just saved you hours of your life!&lt;/li&gt;<br />
line 88  &lt;li&gt;If this didn&#8217;t work, don&#8217;t blame me.  Sometimes life is just like that..&lt;/li&gt;&lt;/ol&gt;<br />
line 89  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;table name&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;table info&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;new db&lt;/td&gt;&lt;td class=&#8217;head&#8217; width=&#8217;25%&#8217;&gt;status&lt;/td&gt;&lt;/tr&gt;&#8221;;</p>
<p>//////////////////////////////////////////////////////////////////////////////////////////////</p>
<p style="text-align: left;">When you get this working Its a thing of Beauty and Saves you Heaps of time</p>
<p style="text-align: left;">Thats it for now do not FTP this file  ACROSS TILL I say !!!</p>
<h3 style="text-align: left;"><span style="font-size: large;">Step7</span></h3>
<p style="text-align: left;">Now the  Next Most Important Part which is setting Up the <strong>db-config.php</strong></p>
<p style="text-align: left;"><a title="Multi DB Configuration File" href="http://freeblog.co.nz/images/db-config.txt " target="_blank">Multi DB Configuratrion</a> this is based on my set up so you may have less Global tables to add or more depending on your Installed plugins</p>
<p style="text-align: left;">There are Four areas of editing here</p>
<p style="text-align: left;"><strong>DB SCALING &gt;&gt;&gt; THIS IS WHERE WE STIPULATE THE AMOUNT OF DATABASES YOU HAVE</strong></p>
<p style="text-align: left;">////////////////&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;////////////////</p>
<p style="text-align: left;">//   E.G  16, 256, 4096<br />
define (&#8216;DB_SCALING&#8217;, &#8217;256&#8242;);</p>
<p style="text-align: left;"><strong>DC IPs  &gt;&gt;&gt; THIS IS THE SERVER IP ADDRESS OF YOUR WEBSITE HOST</strong></p>
<p style="text-align: left;">////////////////&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;////////////////</p>
<p style="text-align: left;">//    Usage: add_dc_ip(IP, DC)<br />
//    EX: add_dc_ip(&#8217;123.123.123.&#8217;, &#8216;dc1&#8242;);<br />
add_dc_ip(&#8217;127.127.127.25&#8242;, &#8216;dc1&#8242;);  this is where you<br />
<strong>GLOBAL TABLES &gt;&gt;&gt; THESE ARE YOUR GLOBAL TABLES</strong></p>
<p style="text-align: left;"><strong> These are an Example of my global tables you must use your own as they will be different<br />
</strong></p>
<p style="text-align: left;"><code>///////////////--------------------------////////////////</code></p>
<p style="text-align: left;">// Do not include default global tables PREFIX as in  Leave off base prefix (eg: <strong>wp_</strong>)</p>
<p style="text-align: left;">//    Usage: add_global_table(TABLE_NAME)<br />
//    EX: add_global_table(&#8216;<strong>something</strong>&#8216;);<br />
add_global_table(&#8216;blogs&#8217;);<br />
add_global_table(&#8216;blogs_cets_topics&#8217;);<br />
add_global_table(&#8216;blogs_cets_topics_relationships&#8217;);<br />
add_global_table(&#8216;blog_activity&#8217;);<br />
add_global_table(&#8216;blog_types&#8217;);<br />
add_global_table(&#8216;blog_versions&#8217;);<br />
add_global_table(&#8216;comment_activity&#8217;);<br />
add_global_table(&#8216;mass_mailer&#8217;);<br />
add_global_table(&#8216;post_activity&#8217;);<br />
add_global_table(&#8216;registration_log&#8217;);<br />
add_global_table(&#8216;signups&#8217;);<br />
add_global_table(&#8216;wsignup_blog_types&#8217;);<br />
add_global_table(&#8216;site&#8217;);<br />
add_global_table(&#8216;sitecategories&#8217;);<br />
add_global_table(&#8216;sitemeta&#8217;);<br />
add_global_table(&#8216;spam&#8217;);<br />
add_global_table(&#8216;support_faq&#8217;);<br />
add_global_table(&#8216;support_faq_cats&#8217;);<br />
add_global_table(&#8216;support_tickets&#8217;);<br />
add_global_table(&#8216;support_tickets_cats&#8217;);<br />
add_global_table(&#8216;support_tickets_messages&#8217;);<br />
add_global_table(&#8216;wusermeta&#8217;);<br />
add_global_table(&#8216;users&#8217;);<br />
add_global_table(&#8216;user_activity&#8217;);</p>
<p style="text-align: left;">Go in thru your server end and get into the Database that way</p>
<p style="text-align: left;">You can get all the global Tables from your Current single WPMU Database wp_global be as thorough as you can take your Time and get it right</p>
<p style="text-align: left;"><strong>These are the CONNECTION DETAILS FOR LOCATION OF DATABASE  these need be correct</strong></p>
<p style="text-align: left;"><a title="Multi DB Configuration File" href="http://freeblog.co.nz/images/db-config.txt " target="_blank">Multi DB Configuratrion</a> Go here and have another Lookat my config file</p>
<p style="text-align: left;">Create your Database SQL <a title="Multi DB Configuration creator" href="http://db-tools.wpmudev.org/db_servers.php" target="_blank">HERE</a> this is a great tool the easy way to create the databases</p>
<p style="text-align: left;"><code>// Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)<br />
// EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');<br />
//<br />
// Note: you can also place this section in a file called db-list.php in wp-content</code></p>
<p style="text-align: left;"><code>add_db_server('global', 'dc1', 1, 1,'127.0.0.1','63.247.133.25', 'freeblog_global', 'someuser', 'xxxx');</code></p>
<p style="text-align: left;">add_db_server(&#8217;00&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_00&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;01&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_01&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;02&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_02&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;03&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_03&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;04&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_04&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;05&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_05&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;06&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_06&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;07&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_07&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;08&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_08&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;09&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_09&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0a&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0a&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0b&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0b&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0c&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0c&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0d&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0d&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0e&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0e&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;0f&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_0f&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;10&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_10&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;11&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_11&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;12&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_12&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;13&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_13&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;14&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_14&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;15&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_15&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;16&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_16&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;17&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_17&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;18&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_18&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;19&#8242;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_19&#8242;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);<br />
add_db_server(&#8217;1a&#8217;, &#8216;dc1&#8242;, 1, 1,&#8217;127.0.0.1&#8242;,&#8217;63.247.133.25&#8242;, &#8216;freeblog_1a&#8217;, &#8216;someuser&#8217;, &#8216;xxxx&#8217;);</p>
<p style="text-align: left;">OK you done yet does your <a title="Multi DB Configuration File" href="http://freeblog.co.nz/images/db-config.txt " target="_blank">Multi DB Configuratrion</a> look like this great lets get to the exciting bit, I bet there is a little bit of paranoia  in the back of your mind follow it and double check!</p>
<h3 style="text-align: left;"><span style="font-size: large;">Step 8</span></h3>
<p style="text-align: left;">So here we are standing at the Abyss ready to take the Plunge Ok lets do it&#8230;</p>
<p style="text-align: left;"><strong>FTP move-blogs.php into wp-content/scripts/move-blogs.php</strong></p>
<p style="text-align: left;">then Open a browser and navigate to www.yoursite.com/wp-content/scripts/move-blogs.php</p>
<p style="text-align: left;">you should see this Image below.</p>
<div id="attachment_94" style="width: 310px" class="wp-caption alignnone"><a href="http://www.billbailey.co.nz/wp-content/uploads/2009/02/multi-db_move-blogs-start-screen.gif"><img class="size-medium wp-image-94" title="multi-db_move-blogs-start-screen" alt="Your Start Screen for Moving Blogs into Multi Databases" src="http://www.billbailey.co.nz/wp-content/uploads/2009/02/multi-db_move-blogs-start-screen-300x225.gif" width="300" height="225" /></a><p class="wp-caption-text">Your Start Screen for Moving Blogs into Multi Databases</p></div>
<p style="text-align: left;">OK no time for hesitation go to step 4 which says..</p>
<p style="text-align: left;"><strong>4.</strong> To start the Copy process <a title="This is where you would click on tne Move Blogs screen" href="http://#">click here</a> this is Just a dummy link on this site for your benefit</p>
<p style="text-align: left;">Ok sit Back its going to take a wee while depending on the size of your database and you will see some error output but do not Panic its Part of the process</p>
<p style="text-align: left;">see image below</p>
<div id="attachment_89" style="width: 310px" class="wp-caption alignnone"><a href="http://www.billbailey.co.nz/wp-content/uploads/2009/02/expected_errors_multidatabase_conversion.gif"><img class="size-medium wp-image-89" title="expected_errors_multidatabase_conversion" alt="Expected output errors during Move process" src="http://www.billbailey.co.nz/wp-content/uploads/2009/02/expected_errors_multidatabase_conversion-300x249.gif" width="300" height="249" /></a><p class="wp-caption-text">Expected output errors during Move process</p></div>
<p style="text-align: left;">after process is completed refresh your Browser and you should see this BELOW</p>
<div id="attachment_88" style="width: 310px" class="wp-caption alignnone"><a href="http://www.billbailey.co.nz/wp-content/uploads/2009/02/completed_multi_database_conversion.gif"><img class="size-medium wp-image-88" title="completed_multi_database_conversion" alt="Blog move into Multi Databases complete" src="http://www.billbailey.co.nz/wp-content/uploads/2009/02/completed_multi_database_conversion-300x225.gif" width="300" height="225" /></a><p class="wp-caption-text">Blog move into Multi Databases complete</p></div>
<p style="text-align: left;">Go get your self a drink and feel happy with yourself you just moved all of your blogs in to  256 Databases (or how ever many you where going for)sit back and revel for a second you did good</p>
<p style="text-align: left;"><strong>Oh and thank you Andrew for you great script</strong></p>
<h3 style="text-align: left;"><span style="font-size: large;">Step 9</span></h3>
<p style="text-align: left;">Ok Now is when you put or FTP the rest of your files across</p>
<p><strong>db.php </strong>- goes in   /wp-content<br />
<strong>db-config.php</strong> &#8211; goes in /wp-content/</p>
<p>these files will take over from your DB CONFIG FILES by default you do not need to change any thing in wp-config.php</p>
<p>Well actually I did just to prove that I was using the new Multi database setup  by commenting out the second line defining the Database name //define(&#8216;DB_NAME&#8217;, &#8216;myold_singledatabase&#8217;);</p>
<p><code>define('WP_CACHE', true); //Added by WP-Cache Manager<br />
<strong>//define('DB_NAME', 'myold_singledatabase');    I commented this line out</strong><br />
define('DB_USER', '<strong>username</strong>');     // Your MySQL username<br />
define('DB_PASSWORD', '<strong>Password</strong>'); // ...and password<br />
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value<br />
define('DB_CHARSET', 'utf8');<br />
define('DB_COLLATE', '');<br />
define('VHOST', 'yes');<br />
$base = '/';</code></p>
<p>Also there is one other part in this config which you just leave alone I&#8217;ve seen a few people get hung up on it so don&#8217;t!</p>
<p><code>define( "WP_USE_MULTIPLE_DB", false );  no need to touch this at all</code></p>
<p style="text-align: left;">
<p>Now also Something else is how the hell do you find where blogs are in 256 Databases easy</p>
<p>First thing is to get the Blog Id and enter it<a title="MD5 Hash tool" href="http://calc.wpmudev.org/md5.php" target="_blank"> here</a> using this MD5 Hash tool say if i put  blog id  2 into the submit box  the result is this</p>
<p><strong>c81e728d9d4c2f636f067f89cc14862c</strong> The relevant parts of this result are the first 2 or three Numbers</p>
<p>Now go to database <strong>c8</strong> and I bet your blog Id 2 tables are there, Magic aye and much faster then tryng to skim 10000 tables</p>
<p>So good Luck if you dont uderstand this or follow it Im sorry let me know where the problem is and I try to clarify it</p>
<p>Regards Bill Bailey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billbailey.co.nz/multi-database-step-by-step-installation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
