My provider installed to my website Drupal Content management systems. Now I want copy my data from old site. I've tables without prefixes during my old DB, however in new DB all tables have "dp_[table_title]" prefix.
write a script which will run Relabel TABLE for every table.
SELECT GROUP_CONCAT('RENAME TABLE `', TABLE_SCHEMA, '`.`', TABLE_NAME, '` TO `', TABLE_SCHEMA, '`.`prefix_', TABLE_NAME, '`;' SEPARATOR ' ') FROM `TABLES` WHERE `TABLE_SCHEMA` = "test";
where "test" is anticipated database title
afterward you can lengthy query which will add prefixes should you carry it out -)
You can just dump the database, open the dump having a text editor, replace all occurrences of "CREATE TABLE " with "CREATE TABLE dp_" and restore the database. It requires a few momemts to complete.