Page 1 of 1

MySQL dump plus rename tables

Posted: Thu 10. Jun 2004, 17:22
by macangelo
Hi

some weeks ago I did 2 pro bono web sites. To save money of the client I put both sites into one phpwcms. Now, since I learned that I can better arange that with "prepend table names" I want to do that bei prepending "et" and "vi".

For this I thought I need to export the MySQL-Database, duplicate it, prepend the table names of one copy with "et" and the tables of the other copy with "vi". Then I would import each copy to the empty database of my new installation and fine.

That's how I thought it out ( as you might have figured out allready you can't call me an MySQL-expert ). But: How do I rename the tables of my copies?

Thanks for any help or better solutions how to do that!

Macangelo

Posted: Thu 10. Jun 2004, 17:42
by Oliver Georgi
Use phpmyadmin - there you can simple change the table names by adding a prefix to each table like 'myprefix_' -> then your renamed phpwcms_article table should be named like: myprefix_phpwcms_article ...and so on.

Then set
$phpwcms["db_prepend"] = "myprefix";

Oliver

Posted: Thu 10. Jun 2004, 18:12
by macangelo
Hi Oliver - thanks for the hope:

PHPMyAdmin is open. I have 5 Tabs: Struktur, SQL, Export, Search, Query. Where and how do I rename the tables?

Thanks a lot!

Macangelo

Posted: Thu 10. Jun 2004, 18:13
by macangelo
Found it!