Example of how I moved 256 to 4096

Hello,
I just setup a practice migration of a 256db setup to a 4096 db..

First I am using a windows machine to make this transition because NTFS supports folders will millions of subfolders and sub files in it.

I did this by dumping all the databases into a single .sql file from my linux servers
something like this..
mysqldump -uroot -p --databases '.LIST ALL DB HERE.' --opt | gzip -c > mysql.sql.gz

Download the .sql dump.
Comment out the USE and CREATE db statements in the dump
Then open the .sql file with a text editor and to a string replace all the
USE "Insert your DB prefix"
replace it with
--USE "Insert your DB prefix"

And I do the same for all the create database statements.
I save the file to "MYSQLDUMP.sql" example..

Then on my windows server I create the first database from the CLI, this would be before you start doing prefixes..

This way you can run the mysql from the command line with one giant statement to import all the tables back into one database.
IMPORT the tables to one database
mysql -uroot -p YOURFIRSTDBNAME < MYSQLDUMP.sql

Ok so now after a long time you will have all the tables in one giant database..

From there you can use the tools
https://premium.wpmudev.org/db-tools/db_sql.php

to create your list of your 4096 databases..
Do that and run those sql commands same as you did for the 256 db..

Modify the move-blogs.php included
Because this is going to take forever to migrate a ton of DB I would execute this scripts from the command line.

Modify the script
Added
if ($_SERVER['argv'][1]){$tabletomove='copy';}
Under $tabletomove = $_REQUEST["table"];
Line 61ish..

Also modify the top of the file so it matches up with your new databases that you created.

run the script

From there just goto the command line where the move-blogs.php script is and enter "php move-blogs.php copy"
Come back in a long time and it should have moved them all..

Thats it you still need to modify the db-config.php to work with your new schemata. But from there I would imagine you would move the databases to different servers or whatever..

That worked for me..