Trying to phpMyAdmin import a database with a different name

importphpmyadmin

I've been searching for answers and couldn't find anything suited for my exact situation :

I have a magento website and i'm trying to "duplicate" the website into another one selling other types of products ,as i just have to change some design-features like logo, some colors, etc.

Problem is this, i export the database from my original website and it's called superdupergen_db .

When i try to import it on the 2'nd website which has topcompresor_db database name, i get name colliding error.
Can someone help me by explaining how to bypass this ?

Thanks !

Chris

Best Answer

There are two possibilities here; the easier one is to use phpMyAdmin to change the name on export.

To do that, you'll need to select the "Custom" radio button on the export page, then under the "Output" section look for "Rename exported databases/tables/columns" -- by selecting that checkbox, you get a dialog box to rename the entire database or specific tables or columns.

The other way is to edit the .sql file and find the references to the old database and correct it with your text editor. It's probably only the initial CREATE statement and USE very shortly after that.