Add Prefix To Existing Vbulletin Tables
If you never used prefixes for your MySQL tables on your vbulletin install and now you want to, here is a little script that will rename all the tables with the desired prefix. You must ONLY RUN THIS SCRIPT ONCE! Upload it to your forum root. After you run it, DELETE IT.
The only thing you can define is the prefix.
Code:
<?php
$prefix = 'vb_';
require_once('./global.php');
$rows = $vbulletin->db->query("SHOW TABLES");
while ($row = $vbulletin->db->fetch_array($rows))
{
$table_name = $row['Tables_in_rib'];
$vbulletin->db->query("ALTER TABLE $table_name RENAME TO $prefix$table_name ");
}
echo "Completed, delete this file immediately!";
?>
|