Multi-DB: Copy specific table data script

After going multi-DB I had a issue with the content of the subscription tables not beeing copied. To fix this I modified the copy-blogs scripts to only copy the content of selected tables (with mysql LIKE).

I wanted to share this script if someone else needed it. I made the script a bit more friendly so hopefully it can help some else in the future. Please see the attatched script (move-specificTables.php).

Documentation for the script:
1. LINE 19-26:
Fill in your database/multi-db details. If you don't know this you can better not use this script :slight_smile:

2. LINE 29: $tablefilterLike ="%_subscriptions";
Change the string to the matching MySQL LIKE syntax. This example will copy all the data from the subscription tables.

That's it run the .php and press the click here link in step 4.

If you want to script to also create the table please add this line to LINE 126:
mysql_query( "CREATE TABLE {$row[0]} LIKE {$dbname}.{$row[0]}" );

You probably want to do some checks around that.

Hope this helps, happy coding!