/**
* Why yes, this *is* another special-purpose Wikimedia maintenance script!
* Should be fixed up and generalized.
/**
* Why yes, this *is* another special-purpose Wikimedia maintenance script!
* Should be fixed up and generalized.
if ( count( $args ) != 2 ) {
wfDie( "Rename external storage dbs and leave a new one...\n" .
"Usage: php renamewiki.php <olddb> <newdb>\n" );
if ( count( $args ) != 2 ) {
wfDie( "Rename external storage dbs and leave a new one...\n" .
"Usage: php renamewiki.php <olddb> <newdb>\n" );
# Initialise external storage
if ( is_array( $wgDefaultExternalStore ) ) {
$stores = $wgDefaultExternalStore;
# Initialise external storage
if ( is_array( $wgDefaultExternalStore ) ) {
$stores = $wgDefaultExternalStore;
$extdb->query( "SET table_type=InnoDB" );
$extdb->query( "CREATE DATABASE {$to}" );
$extdb->query( "ALTER TABLE {$from}.blobs RENAME TO {$to}.blobs" );
$extdb->query( "SET table_type=InnoDB" );
$extdb->query( "CREATE DATABASE {$to}" );
$extdb->query( "ALTER TABLE {$from}.blobs RENAME TO {$to}.blobs" );
dbsource( "$maintenance/storage/blobs.sql", $extdb );
$extdb->immediateCommit();
}
dbsource( "$maintenance/storage/blobs.sql", $extdb );
$extdb->immediateCommit();
}